Skip to content

Commit

Permalink
docs: Update examples and docs to add security context (#6608)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Jul 30, 2024
1 parent a5d5473 commit a0df7a2
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 35 deletions.
8 changes: 7 additions & 1 deletion examples/workloads/arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: arm64
spec:
replicas: 0
replicas: 1
selector:
matchLabels:
app: arm64
Expand All @@ -12,12 +12,18 @@ spec:
labels:
app: arm64
spec:
securityContext:
runAsUser: 2000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: arm64
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegedEscalation: false
nodeSelector:
kubernetes.io/arch: arm64
6 changes: 6 additions & 0 deletions examples/workloads/disruption-budget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ spec:
labels:
app: pdb
spec:
securityContext:
runAsUser: 2000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: pdb
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegedEscalation: false
nodeSelector:
kubernetes.io/arch: amd64
8 changes: 7 additions & 1 deletion examples/workloads/gpu-amd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
labels:
app: gpu-amd
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: gpu-amd
Expand All @@ -20,4 +24,6 @@ spec:
amd.com/gpu: "1"
requests:
cpu: "1"
memory: 256M
memory: 256M
securityContext:
allowPrivilegedEscalation: false
8 changes: 7 additions & 1 deletion examples/workloads/gpu-nvidia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
labels:
app: gpu-nvidia
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: gpu-nvidia
Expand All @@ -20,4 +24,6 @@ spec:
nvidia.com/gpu: "1"
requests:
cpu: "1"
memory: 256M
memory: 256M
securityContext:
allowPrivilegedEscalation: false
6 changes: 6 additions & 0 deletions examples/workloads/inflate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ spec:
labels:
app: inflate
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: inflate
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegeEscalation: false
8 changes: 7 additions & 1 deletion examples/workloads/neuron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
labels:
app: neuron
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: neuron
Expand All @@ -20,4 +24,6 @@ spec:
aws.amazon.com/neuron: "1"
requests:
cpu: "1"
memory: 256M
memory: 256M
securityContext:
allowPrivilegeEscalation: false
8 changes: 7 additions & 1 deletion examples/workloads/prefer-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
labels:
app: prefer-arm
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -35,4 +39,6 @@ spec:
resources:
requests:
cpu: "1"
memory: 256M
memory: 256M
securityContext:
allowPrivilegeEscalation: false
6 changes: 6 additions & 0 deletions examples/workloads/spot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ spec:
labels:
app: spot
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: spot
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegeEscalation: false
nodeSelector:
karpenter.sh/capacity-type: spot
6 changes: 6 additions & 0 deletions examples/workloads/spread-hostname-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ spec:
labels:
app: host-zone-spread
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: host-zone-spread
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegeEscalation: false
topologySpreadConstraints:
- labelSelector:
matchLabels:
Expand Down
6 changes: 6 additions & 0 deletions examples/workloads/spread-hostname.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ spec:
labels:
app: host-spread
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: host-spread
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegeEscalation: false
topologySpreadConstraints:
- labelSelector:
matchLabels:
Expand Down
6 changes: 6 additions & 0 deletions examples/workloads/spread-zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ spec:
labels:
app: zone-spread
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- image: public.ecr.aws/eks-distro/kubernetes/pause:3.2
name: zone-spread
resources:
requests:
cpu: "1"
memory: 256M
securityContext:
allowPrivilegeEscalation: false
topologySpreadConstraints:
- labelSelector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ spec:
app: inflate
spec:
terminationGracePeriodSeconds: 0
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
- name: inflate
image: public.ecr.aws/eks-distro/kubernetes/pause:3.7
resources:
requests:
cpu: 1
securityContext:
allowPrivilegeEscalation: false
EOF

kubectl scale deployment inflate --replicas 5
Expand Down

0 comments on commit a0df7a2

Please sign in to comment.