Files
CKS-Lessons/lab/lesson-33-answer.yaml
2026-08-26 19:37:55 +06:00

50 lines
1.2 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: context-lab
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: report-api
namespace: context-lab
spec:
replicas: 1
selector:
matchLabels:
app: report-api
template:
metadata:
labels:
app: report-api
spec:
securityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
volumes:
- name: log-exporter-vol
emptyDir: {}
containers:
- name: api
image: nginxinc/nginx-unprivileged:1.27-alpine
ports:
- containerPort: 8080
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
- name: log-exporter
image: busybox:1.37
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
readOnlyRootFilesystem: true
command: ["sh", "-c", "while true; do date >> /var/cache/exporter/events.log; sleep 30; done"]
volumeMounts:
- name: log-exporter-vol
mountPath: /var/cache/exporter