I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …
:date_long | 1 min Read
MOCK TEST 3 CKA
controlplane $ for i in $(ls *.yaml); do echo -e "$i\n\n"; cat $i; done
03.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: multi-pod
name: multi-pod
spec:
containers:
- image: nginx
name: alpha
env:
- name: name
value: "alpha"
- image: busybox
name: beta
env:
- name: name
value: "beta"
command: ["sh", "-c", "sleep 4800"]
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
04.yaml
apiVersion: v1
kind: Pod
metadata:
name: non-root-pod
spec:
securityContext:
runAsUser: 1000
fsGroup: 2000
containers:
- name: non-root-pod
image: redis:alpine
05.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
run: np-test-1
policyTypes:
- Ingress
ingress:
- from:
ports:
- protocol: TCP
port: 80
606.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: prod-redis
name: prod-redis
spec:
containers:
- image: redis:alpine
name: prod-redis
resources: {}
tolerations:
- key: "env_type"
operator: "Equal"
value: "production"
effect: "NoSchedule"
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}