kubernetes 1.24 -> 1.29 업그레이드 준비하기

cloud2000·2024년 3월 3일

현재 사용중인 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

v1.25

  • 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>
  • MODE: enforce(차단됨), audit(허용되지만 감사 로그에 표시됨), warn(허용되지만 경고가 표시됨).
  • LEVEL: PSS의 어떤 프로파일이 privileged(완전히 제한되지 않음), baseline(최소한으로 제한됨), restricted(매우 제한적)
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")
  • cluster에 global 설정
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: []
  • PSA로 마이그레이션 방법
    https://kubernetes.io/docs/tasks/configure-pod-container/migrate-from-psp
  • 임시 컨테이너
    POD를 디버깅하기 위해 사용하는 임시 컨테이너임. 대상 컨테이너와 파일 시스템 및 프로세스 네임스페이스에 액세스 할 수 있음.
  • Network Policy endPort is Stable
  • Cgrups v2 is stable
  • DaemonSet maxSurge is stable
  • Local emphemeral storage capacity isolation is stable
  • Core CSI migration is stable
  • KMS v2

v1.26

  • registry.k8s.io 레지스트리에 독점적으로 게시된 첫 번째 릴리스입니다. 이전 k8s.gcr.io 레지스트리에서는 v1.26 이전 릴리스의 태그만 계속 업데이트됩니다
  • CRI v1alpha2 removed
  • Storage improvements
  • Delegate FSGroup to CSI Driver graduated to stable
  • Feature metrics are now available
  • apiserver.k8s.io/v1beta1
  • autoscaling/v2 사용

v1.27

  • Removal of --container-runtime command line argument

참고)

profile
클라우드쟁이

0개의 댓글