Profile picture

[k8s] kubeadm-config YAML 형식으로 조회하기

JaehyoJJAng2023년 04월 12일

kubeadm-config

kubernetes 클러스터 설정에 공인 아이피를 추가하거나 내부 클러스터 cidr 서브넷이 궁금한 경우 등의 상황에서 kubectl 커맨드를 사용하여 쉽게 조회/추가가 가능하다.

$ kubectl get configmap -n kube-system
NAME                                                   DATA   AGE
coredns                                                1      7d3h
extension-apiserver-authentication                     6      7d3h
kube-apiserver-legacy-service-account-token-tracking   1      7d3h
kube-proxy                                             2      7d3h
kube-root-ca.crt                                       1      7d3h
kubeadm-config                                         1      7d3h
kubelet-config                                         1      7d3h
$ kubectl get configmap kubeadm-config -n kube-system -o yaml
apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      extraArgs:
        authorization-mode: Node,RBAC
      timeoutForControlPlane: 4m0s
    apiVersion: kubeadm.k8s.io/v1beta3
    certificatesDir: /etc/kubernetes/pki
    clusterName: kubernetes
    controllerManager: {}
    dns: {}
    etcd:
      local:
        dataDir: /var/lib/etcd
    imageRepository: registry.k8s.io
    kind: ClusterConfiguration
    kubernetesVersion: v1.27.6
    networking:
      dnsDomain: cluster.local
      podSubnet: 20.96.0.0/12
      serviceSubnet: 10.96.0.0/12
    scheduler: {}
kind: ConfigMap
metadata:
  creationTimestamp: "2023-10-04T04:31:50Z"
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "192"
  uid: ff76d794-69f9-4030-a590-76a2e9464640

Loading script...