config
├── new
├── view
└── sync
config new
since v1.0.0
config/cubectl.toml
에 새로운 cubectl.toml
파일을 생성합니다.
$ cubectl config new
-a, --auto-approve
optional
y/n 질의 절차를 생략합니다.
$ bin/cubectl config new
Do you really want to make a new config file?
Is this ok [y/n]: y
[cubectl]
## Required
## - local-repository-install: local repository installation activate. (Required when selecting the closed network.)
## It is installed on the registry host.
## - local-repository-url: local repository service url (Required when selecting the closed network.)
## If you are installing a private repository, you can skip it. (default: registry-ip)
## Optional
## - cluster-name: use cluster name in config context (default: "kubernetes")
## - install-dir: installation scripts(harbor, shell scripts) save directory (default: "/var/lib/cubectl")
## - cert-validity-days: SSL validity days(default: 36500)
## - closed-network: Enable Air Gap (default: false)
#cluster-name = "kubernetes"
#install-dir = "/var/lib/cubectl"
#cert-validity-days = 36500
#debug-mode = false
#closed-network = false
#local-repository-install = false
#local-repository-url = "http://x.x.x.x"
[kubernetes]
## Required
## -
## Optional
## - version: Kubernetes version (default: "latest")
## If you input only the major version, the minor version automatically selects the last version.
## - container-runtime: use k8s cri (only containerd)
## - kube-proxy-mode: use k8s proxy mode [iptables | ipvs] (default: "ipvs")
## - service-cidr: k8s service network cidr (default: "10.96.0.0/20")
## - pod-cidr: k8s pod network cidr (default: "10.4.0.0/16")
## - node-port-range: k8s node port network range (default: "30000-32767")
## - audit-log-enable: k8s audit log enabled (default: true)
## - api-sans: Add k8s apiserver SAN [--apiserver-cert-extra-sans same as setting] (default: master[0] ip address)
#version = "v1.23.13"
#container-runtime = "containerd"
#kube-proxy-mode = "ipvs"
#service-cidr = "10.96.0.0/20"
#pod-cidr = "10.4.0.0/16"
#node-port-range = "30000-32767"
#audit-log-enable = true
#api-sans = ["x.x.x.x"]
[kubernetes.etcd]
## Required
## - ip: k8s control plane nodes ip address. (Required when selecting the external-etcd="true")
## - private-ip: K8s control plane nodes private ip address. (Required when selecting the external-etcd="true")
## If you use the same IP address, you can skip it.
## Optional
## - external-etcd: used external etcd than input the ip and private-ip address (default: false)
## not used than skip ip address. it is used control plane nodes as automatic.
#external-etcd = false
#ip = ["x.x.x.x"]
#private-ip = ["x.x.x.x"]
[kubernetes.calico]
## Required
## -
## Optional
## - vxlan-mode: calico VXLAN mode activate (default: false)
#vxlan-mode = false
[node-pool]
## Required
## -
## Optional
## - data-dir: data(backup, docker, log, kubelet, etcd, k8s-audit, containerd) root dir (default: "/data")
## - ssh-port: Node ssh port (default: 22)
#data-dir = "/data"
#ssh-port = 22
[node-pool.master]
## Required
## - ip: k8s control plane nodes ip address.
## - private-ip: K8s control plane nodes private ip address.
## If you use the same IP address, you can skip it.
## Optional
## - lb-ip: load balancer ip address (default: master[0] node ip address)
## - isolated: K8s control plane nodes isolated (default: true)
## - haproxy-install: used internal load-balancer (default: true)
## - lb-ip: Enter the IP address when using a load balancer (default: master[0] ip address)
## - lb-port: Enter the port when using a load balancer (default: 6443)
#ip = ["x.x.x.x","x.x.x.x","x.x.x.x"]
#private-ip = ["x.x.x.x","x.x.x.x","x.x.x.x"]
#isolated = true
#haproxy-install = true
#lb-ip = "x.x.x.x"
#lb-port = 6443
[node-pool.node]
## Required
## - ip: k8s work nodes ip address.
## - private-ip: K8s work nodes private ip address.
## If you use the same IP address, you can skip it.
## Optional
#ip = ["x.x.x.x", "x.x.x.x"]
#private-ip = ["x.x.x.x", "x.x.x.x"]
[private-registry]
## Required
## - registry-ip: Public IP address of the private registry node.
## This is a required entry used when installing a private registry.
## - private-ip: Private IP address of the private registry node.
## This is a required entry used when installing a private registry.
## If you use the same IP address, you can skip it.
## Optional
## - install: private registry install (default: false)
## - data-dir: private registry data directory (default: "/data/harbor")
## - public-cert: public cert activate (default: false)
## - cocktail-archive-file: Push cocktail addons and image files to the harbor (default:"")
#install = false
#registry-ip = "x.x.x.x"
#private-ip = "x.x.x.x"
#registry-domain = "x.x.x.x"
#data-dir = "/data/harbor"
#public-cert = false
#cocktail-archive-file = ""
[private-registry.cert-file]
## Required
## - ssl-certificate: The certificate path used when using public-cert.
## This is a required field used when using a public certificate.
## - ssl-certificate-key: The certificate-key used when using public-cert.
## This is a required field used when using a public certificate.
## Optional
#ssl-certificate = ""
#ssl-certificate-key = ""
[shared-storage]
## Required
## - storage-ip: Storage node ip address.
## This is a required field used when installing the nfs server.
## (this is using it to generate an inventory and generate an extra vars)
## - private-ip: Storage node ip address.
## This is a required field used when installing the nfs server.
## If you use the same IP address, you can skip it.
## (this is using it to generate an inventory)
## - volume-dir: Storage node data directory. (default: /data/storage)
## This is a required field used when installing the nfs server.
## (this is using it to generate an extra vars)
## Optional
## - install: NFS Server Installation (default: false)
#install = false
#storage-ip = "x.x.x.x"
#private-ip = "x.x.x.x"
#volume-dir = "/data/storage"
#nfs_version = "4.1"
config view
since v1.0.0
cubectl.toml
파일의 내용을 확인합니다.
$ cubectl config view
$ bin/cubectl config view
[cubectl]
[kubernetes]
version = "v1.23.13"
[kubernetes.etcd]
[kubernetes.calico]
[node-pool]
[node-pool.master]
ip = ["x.x.x.x","x.x.x.x","x.x.x.x"]
[node-pool.node]
[private-registry]
[private-registry.cert-file]
[shared-storage]
[prepare-airgap]
config sync
~~~since v1.0.0 (deprecated v1.2.0)
~~~해당 파일은 Control-Plane 노드의 `/etc/kubernetes/cubectl-config-cm.yaml` 에 존재합니다.~~~
### parameters
* `-p <ssh key>`
* 설치 호스트들의 Passwordless SSH 연결을 위한 Private-Key 입니다.
* `-u <username>`
* 설치 호스트들의 Passwordless SSH 연결을 위한 사용자 계정명 입니다.
* `-a, --auto-approve`
* _optional_
* y/n 질의 절차 생략.
### examples
```
$ bin/cubectl config sync -p ~/.ssh/id_rsa -u cocktail
## Inventory for Sync the configuration task.
================================================================
Node Name IP Private IP
================================================================
node-0 x.x.x.x
================================================================
Is this ok [y/n]: y
```