首页 > 其他分享 >k8s init

k8s init

时间:2022-12-12 16:11:47浏览次数:42  
标签:control kube 05 08 17955 init go k8s

[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
I1212 08:05:00.080528 17955 checks.go:842] using image pull policy: IfNotPresent
I1212 08:05:00.115540 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/kube-apiserver:v1.23.15
I1212 08:05:00.151174 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.23.15
I1212 08:05:00.186064 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/kube-scheduler:v1.23.15
I1212 08:05:00.218906 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/kube-proxy:v1.23.15
I1212 08:05:00.252437 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/pause:3.6
I1212 08:05:00.286467 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/etcd:3.5.6-0
I1212 08:05:00.319628 17955 checks.go:851] image exists: registry.aliyuncs.com/google_containers/coredns:v1.8.6
[certs] Using certificateDir folder "/etc/kubernetes/pki"
I1212 08:05:00.319839 17955 certs.go:112] creating a new certificate authority for ca
[certs] Generating "ca" certificate and key
I1212 08:05:00.401788 17955 certs.go:522] validating certificate period for ca certificate
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [k8s-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [192.168.200.1 192.168.106.130]
[certs] Generating "apiserver-kubelet-client" certificate and key
I1212 08:05:00.799028 17955 certs.go:112] creating a new certificate authority for front-proxy-ca
[certs] Generating "front-proxy-ca" certificate and key
I1212 08:05:00.967572 17955 certs.go:522] validating certificate period for front-proxy-ca certificate
[certs] Generating "front-proxy-client" certificate and key
I1212 08:05:01.141784 17955 certs.go:112] creating a new certificate authority for etcd-ca
[certs] Generating "etcd/ca" certificate and key
I1212 08:05:01.242600 17955 certs.go:522] validating certificate period for etcd/ca certificate
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [k8s-master localhost] and IPs [192.168.106.130 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [k8s-master localhost] and IPs [192.168.106.130 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
I1212 08:05:02.004214 17955 certs.go:78] creating new public/private key files for signing service account users
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
I1212 08:05:02.264547 17955 kubeconfig.go:103] creating kubeconfig file for admin.conf
[kubeconfig] Writing "admin.conf" kubeconfig file
I1212 08:05:02.815151 17955 kubeconfig.go:103] creating kubeconfig file for kubelet.conf
[kubeconfig] Writing "kubelet.conf" kubeconfig file
I1212 08:05:02.918644 17955 kubeconfig.go:103] creating kubeconfig file for controller-manager.conf
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
I1212 08:05:03.110309 17955 kubeconfig.go:103] creating kubeconfig file for scheduler.conf
[kubeconfig] Writing "scheduler.conf" kubeconfig file
I1212 08:05:03.171834 17955 kubelet.go:65] Stopping the kubelet
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
I1212 08:05:04.108028 17955 manifests.go:99] [control-plane] getting StaticPodSpecs
I1212 08:05:04.108239 17955 certs.go:522] validating certificate period for CA certificate
I1212 08:05:04.108314 17955 manifests.go:125] [control-plane] adding volume "ca-certs" for component "kube-apiserver"
I1212 08:05:04.108335 17955 manifests.go:125] [control-plane] adding volume "etc-ca-certificates" for component "kube-apiserver"
I1212 08:05:04.108343 17955 manifests.go:125] [control-plane] adding volume "etc-pki" for component "kube-apiserver"
I1212 08:05:04.108359 17955 manifests.go:125] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"
I1212 08:05:04.108365 17955 manifests.go:125] [control-plane] adding volume "usr-local-share-ca-certificates" for component "kube-apiserver"
I1212 08:05:04.108381 17955 manifests.go:125] [control-plane] adding volume "usr-share-ca-certificates" for component "kube-apiserver"
I1212 08:05:04.110227 17955 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-apiserver" to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
I1212 08:05:04.110263 17955 manifests.go:99] [control-plane] getting StaticPodSpecs
I1212 08:05:04.110479 17955 manifests.go:125] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"
I1212 08:05:04.110487 17955 manifests.go:125] [control-plane] adding volume "etc-ca-certificates" for component "kube-controller-manager"
I1212 08:05:04.110492 17955 manifests.go:125] [control-plane] adding volume "etc-pki" for component "kube-controller-manager"
I1212 08:05:04.110496 17955 manifests.go:125] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
I1212 08:05:04.110501 17955 manifests.go:125] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
I1212 08:05:04.110506 17955 manifests.go:125] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"
I1212 08:05:04.110510 17955 manifests.go:125] [control-plane] adding volume "usr-local-share-ca-certificates" for component "kube-controller-manager"
I1212 08:05:04.110514 17955 manifests.go:125] [control-plane] adding volume "usr-share-ca-certificates" for component "kube-controller-manager"
I1212 08:05:04.111282 17955 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-controller-manager" to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[control-plane] Creating static Pod manifest for "kube-scheduler"
I1212 08:05:04.111316 17955 manifests.go:99] [control-plane] getting StaticPodSpecs
I1212 08:05:04.111498 17955 manifests.go:125] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"
I1212 08:05:04.111882 17955 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-scheduler" to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
I1212 08:05:04.113149 17955 local.go:65] [etcd] wrote Static Pod manifest for a local etcd member to "/etc/kubernetes/manifests/etcd.yaml"
I1212 08:05:04.113177 17955 waitcontrolplane.go:91] [wait-control-plane] Waiting for the API server to be healthy
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 6.512584 seconds
I1212 08:05:10.628193 17955 uploadconfig.go:110] [upload-config] Uploading the kubeadm ClusterConfiguration to a ConfigMap
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
I1212 08:05:10.640649 17955 uploadconfig.go:124] [upload-config] Uploading the kubelet component config to a ConfigMap
[kubelet] Creating a ConfigMap "kubelet-config-1.23" in namespace kube-system with the configuration for the kubelets in the cluster
NOTE: The "kubelet-config-1.23" naming of the kubelet ConfigMap is deprecated. Once the UnversionedKubeletConfigMap feature gate graduates to Beta the default name will become just "kubelet-config". Kubeadm upgrade will handle this transition transparently.
I1212 08:05:10.649615 17955 uploadconfig.go:129] [upload-config] Preserving the CRISocket information for the control-plane node
I1212 08:05:10.649653 17955 patchnode.go:31] [patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to the Node API object "k8s-master" as an annotation
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node k8s-master as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node k8s-master as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: shvmnk.buu57x92o0wiy1tl
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
I1212 08:05:11.692140 17955 clusterinfo.go:47] [bootstrap-token] loading admin kubeconfig
I1212 08:05:11.692595 17955 clusterinfo.go:58] [bootstrap-token] copying the cluster from admin.conf to the bootstrap kubeconfig
I1212 08:05:11.692866 17955 clusterinfo.go:70] [bootstrap-token] creating/updating ConfigMap in kube-public namespace
I1212 08:05:11.698999 17955 clusterinfo.go:84] creating the RBAC rules for exposing the cluster-info ConfigMap in the kube-public namespace
I1212 08:05:11.705574 17955 kubeletfinalize.go:90] [kubelet-finalize] Assuming that kubelet client certificate rotation is enabled: found "/var/lib/kubelet/pki/kubelet-client-current.pem"
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
I1212 08:05:11.706533 17955 kubeletfinalize.go:134] [kubelet-finalize] Restarting the kubelet to enable client certificate rotation
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.106.130:6443 --token shvmnk.buu57x92o0wiy1tl \
--discovery-token-ca-cert-hash sha256:53f12ff7a46e0ec8dcfe4f53f7f49b6b84302eb4d138c57dea1c7a913ebd2166

标签:control,kube,05,08,17955,init,go,k8s
From: https://www.cnblogs.com/ruiy/p/16976341.html

相关文章

  • K8S Pod status的状态分析 扩容及缩容
    K8SPodstatus的状态分析CrashLoopBackOff:容器退出,kubelet正在将它重启InvalidImageName:无法解析镜像名称ImageInspectError:无法校验镜像ErrImageNeverPull:策略......
  • 如何远程调试k8s里的jettypod
     ​课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。介绍主要的k8s资源的使用配置和命......
  • k8s中安装jenkins
    编写jenkins.yaml说明:容器跑起来后,jenkins的目录是/var/jenkins_home存储卷用的是hostPath,这里面我们指定pod调度到k8s-master01在k8s-master01上创建目录:mkdir/da......
  • k8s容器内部通过Prometheus Operator部署MySQL Exporter监控k8s集群外部的MySQL
    写在前面在按照下面步骤操作之前,请先确保服务器已经部署k8s,prometheus,prometheusoperator,关于这些环境的部署,可以自行查找相关资料安装部署,本文档便不在此赘述。关于pro......
  • k8s在pod内访问集群外部地址
    一.使用IPapiVersion:v1kind:Servicemetadata:name:nginx-ipspec:ports:-protocol:TCPport:88---apiVersion:v1kind:Endpointsmetadat......
  • VMware快速搭建k8s集群 (CentOS-7.9|Docker-19.03.11|K8S-1.19.6|Flannel)kubeadm安装
    0.规划k8s-master192.168.239.120CPU:2核 内存:2G 磁盘:10GCentOS7.9k8s-node1192.168.239.121CPU:2核 内存:2G 磁盘:10GCentOS7.9k8s-node2192......
  • k8s 架构
    k8s基本架构MasterNode:控制面的节点WorkerNode:干活的节点Master中的组件APIServer:APIServer是整个k8s集群的唯一入口。Etcd:持久化存储,存储集群中各种资源的......
  • k8s API
    Job-CronJobJob:临时离线任务CronJob:定时离线任务Yaml文件描述Job:apiVersion:batch/v1kind:Jobmetadata:name:...labels:k:vk:v......
  • k8s Pod
    Pod是k8s的核心对象Pod是在k8s中创造,管理的最小可部署计算单元。通常不需要直接创建Pod,k8s集群中Pod主要有两种用法:运行单个容器的Pod运行包含多个容......
  • 使用kubeadm快速部署一个k8s集群
    kubeadm是官方社区推出的一个用于快速部署kubernetes集群的工具。这个工具能通过两条指令完成一个kubernetes集群的部署:#创建一个Master节点$kubeadminit#将一个N......