
현재 사용중인 k8s v1.24에서 최신버전인 v1.29까지의 주요 변경 사항을 조사해 본다.
cni: v0.9.1
crictl: 1.22.0
docker: 20.10.8
etcd: v3.4.13
helm: v3.6.3
Kubeadm: stop applying the "node-role.kubernetes.io/master:NoSchedule" taint to control plane nodes for new clusters. Remove the taint from existing control plane nodes during "kubeadm upgrade apply"
PSP(PodSecurityPolicy)가 완전 제거되고 PSA(Pod Security Admission)가 안정적인 버전으로 출시됨.
PSA 컨트롤러는 PSS(Pod Security Standard) 표준에 대한 구현이다. k8s v1.23부터는 기본적으로 활성화 된다. PSA는 namespace에 적절한 label를 설정하면 된다.
pod-security.kubernetes.io/<MODE>: <LEVEL>
or
pod-security.kubernetes.io/<MODE>-version: <VERSION>
apiVersion: v1
kind: Namespace
metadata:
name: example
labels:
pod-security.kubernetes.io/audit: restricted
cat <<EOF | kubectl create -n example -f -
apiVersion: v1
kind: Pod
metadata:
name: my-nginx-pod
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
protocol: TCP
EOF
Error from server (Forbidden): error when creating "STDIN": pods "my-nginx-pod" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "nginx" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "nginx" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "nginx" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "nginx" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
apiVersion: apiserver.config.k8s.io/v1
kind: AdmissionConfiguration
plugins:
- name: PodSecurity
configuration:
defaults:
enforce: "privileged"
enforce-version: "latest"
audit: "priviledged"
audit-version: "latest"
warn: "privileged"
warn-version: "latest"
exemptions:
usernames: []
runtimeClasses: []
namespaces: []
참고)