Skip to content

Commit

Permalink
Merge pull request #6052 from zhzhuang-zju/securityContext
Browse files Browse the repository at this point in the history
config security context
  • Loading branch information
karmada-bot authored Jan 17, 2025
2 parents 9a30bc9 + 3e9ef29 commit 4f86921
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 1 deletion.
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-aggregated-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ spec:
- name: karmada-aggregated-apiserver
image: docker.io/karmada/karmada-aggregated-apiserver:latest
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
privileged: false
command:
- /bin/karmada-aggregated-apiserver
- --kubeconfig=/etc/karmada/config/karmada.config
Expand Down Expand Up @@ -77,6 +80,9 @@ spec:
- name: etcd-client-cert
secret:
secretName: karmada-aggregated-apiserver-etcd-client-cert
securityContext:
seccompProfile:
type: RuntimeDefault
---
apiVersion: v1
kind: Service
Expand Down
7 changes: 6 additions & 1 deletion artifacts/deploy/karmada-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ spec:
- name: service-account-key-pair
mountPath: /etc/karmada/pki/service-account-key-pair
readOnly: true
securityContext:
allowPrivilegeEscalation: false
privileged: false
volumes:
- name: server-cert
secret:
Expand All @@ -121,7 +124,9 @@ spec:
priorityClassName: system-node-critical
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
securityContext:
seccompProfile:
type: RuntimeDefault
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
operator: Exists
containers:
- name: karmada-controller-manager
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-controller-manager:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -53,3 +56,6 @@ spec:
- name: karmada-config
secret:
secretName: karmada-controller-manager-config
securityContext:
seccompProfile:
type: RuntimeDefault
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-descheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
operator: Exists
containers:
- name: karmada-descheduler
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-descheduler:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -58,3 +61,6 @@ spec:
- name: scheduler-estimator-client-cert
secret:
secretName: karmada-descheduler-scheduler-estimator-client-cert
securityContext:
seccompProfile:
type: RuntimeDefault
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ spec:
- operator: Exists
containers:
- name: etcd
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: registry.k8s.io/etcd:3.5.16-0
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -88,6 +91,9 @@ spec:
mountPath: /etc/karmada/pki/server
- name: etcd-client-cert
mountPath: /etc/karmada/pki/etcd-client
securityContext:
seccompProfile:
type: RuntimeDefault
volumes:
- name: etcd-data
hostPath:
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-metrics-adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ spec:
automountServiceAccountToken: false
containers:
- name: karmada-metrics-adapter
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-metrics-adapter:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -71,6 +74,9 @@ spec:
- name: server-cert
secret:
secretName: karmada-metrics-adapter-cert
securityContext:
seccompProfile:
type: RuntimeDefault
---
apiVersion: v1
kind: Service
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-scheduler-estimator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
operator: Exists
containers:
- name: karmada-scheduler-estimator
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-scheduler-estimator:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -59,6 +62,9 @@ spec:
- name: member-kubeconfig
secret:
secretName: {{member_cluster_name}}-kubeconfig
securityContext:
seccompProfile:
type: RuntimeDefault
---
apiVersion: v1
kind: Service
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
operator: Exists
containers:
- name: karmada-scheduler
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-scheduler:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -59,3 +62,6 @@ spec:
- name: scheduler-estimator-client-cert
secret:
secretName: karmada-scheduler-scheduler-estimator-client-cert
securityContext:
seccompProfile:
type: RuntimeDefault
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ spec:
automountServiceAccountToken: false
containers:
- name: karmada-search
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-search:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -70,6 +73,9 @@ spec:
- name: etcd-client-cert
secret:
secretName: karmada-search-etcd-client-cert
securityContext:
seccompProfile:
type: RuntimeDefault
---
apiVersion: v1
kind: Service
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/karmada-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
operator: Exists
containers:
- name: karmada-webhook
securityContext:
allowPrivilegeEscalation: false
privileged: false
image: docker.io/karmada/karmada-webhook:latest
imagePullPolicy: IfNotPresent
command:
Expand Down Expand Up @@ -56,6 +59,9 @@ spec:
- name: server-cert
secret:
secretName: karmada-webhook-cert
securityContext:
seccompProfile:
type: RuntimeDefault
---
apiVersion: v1
kind: Service
Expand Down
6 changes: 6 additions & 0 deletions artifacts/deploy/kube-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ spec:
- --v=4
image: registry.k8s.io/kube-controller-manager:{{karmada_apiserver_version}}
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
privileged: false
livenessProbe:
failureThreshold: 8
httpGet:
Expand Down Expand Up @@ -91,3 +94,6 @@ spec:
- name: service-account-key-pair
secret:
secretName: kube-controller-manager-service-account-key-pair
securityContext:
seccompProfile:
type: RuntimeDefault

0 comments on commit 4f86921

Please sign in to comment.