首页
直播
统计
壁纸
留言
友链
关于
Search
1
PVE开启硬件显卡直通功能
2,557 阅读
2
在k8s(kubernetes) 上安装 ingress V1.1.0
2,059 阅读
3
二进制安装Kubernetes(k8s) v1.24.0 IPv4/IPv6双栈
1,922 阅读
4
Ubuntu 通过 Netplan 配置网络教程
1,842 阅读
5
kubernetes (k8s) 二进制高可用安装
1,793 阅读
默认分类
登录
/
注册
Search
chenby
累计撰写
199
篇文章
累计收到
124
条评论
首页
栏目
默认分类
页面
直播
统计
壁纸
留言
友链
关于
搜索到
199
篇与
cby
的结果
2022-05-18
kubernetes(k8s)常用deploy模板 并验证
kubernetes常用deploy模板,并验证编写deploy配置文件root@hello:~# cat deploy.yaml apiVersion: apps/v1 kind: Deployment metadata: name: hostname-test-cby labels: name: hostname-test-cby spec: # 副本数 replicas: 10 # 标签选择器 selector: matchLabels: name: hostname-test-cby # 更新策略 strategy: rollingUpdate: maxSurge: 3 # 更新最大数量 maxUnavailable: 3 #更新时最大不可用数量 type: RollingUpdate #滚动更新 # 模板 template: metadata: labels: name: hostname-test-cby spec: # 配置容器 containers: - name: hostname-test-cby #容器名 image: nginx #镜像 imagePullPolicy: IfNotPresent # 拉取策略 resources: requests: cpu: "100m" #CPU限制 memory: "300M" #内存限制 # 健康监测 livenessProbe: httpGet: path: / # 探测路径 port: 80 # 端口 initialDelaySeconds: 15 # 第一次探测等待 timeoutSeconds: 3 # 探测的超时后等待多少秒 # 就绪探测 readinessProbe: httpGet: path: / # 探测路径 port: 80 # 端口 initialDelaySeconds: 10 # 第一次探测等待 timeoutSeconds: 3 # 探测的超时后等待多少秒 #环境变量 env: - name: cby value: chenby # 配置容器端口 ports: - containerPort: 80 # 配置挂载到目录 volumeMounts: - mountPath: /usr/share/nginx/html/ name: data # 配置目录挂载 volumes: - name: data hostPath: path: /html/ type: Directory # 配置指定解析 hostAliases: - ip: "192.168.1.1" #IP地址 hostnames: - "cby" #主机名 - "cby.chenby.cn" #主机名 - ip: "192.168.1.10"#IP地址 hostnames: - "chenby" #主机名 - "chenby.chenby.cn" #主机名 root@hello:~# 执行deploy配置文件root@hello:~# kubectl apply -f deploy.yaml deployment.apps/hostname-test-cby created root@hello:~# mkdir /html root@hello:~# echo 123 > /html/index.html root@hello:~# kubectl get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES hostname-test-cby-86df45bf-9fx5n 1/1 Running 0 43s 172.17.125.38 k8s-node01 <none> <none> hostname-test-cby-86df45bf-cmv2b 1/1 Running 0 43s 172.17.125.37 k8s-node01 <none> <none> hostname-test-cby-86df45bf-f6drb 1/1 Running 0 43s 172.17.125.41 k8s-node01 <none> <none> hostname-test-cby-86df45bf-g79x2 1/1 Running 0 43s 172.27.14.232 k8s-node02 <none> <none> hostname-test-cby-86df45bf-h6blv 1/1 Running 0 43s 172.27.14.233 k8s-node02 <none> <none> hostname-test-cby-86df45bf-hqjnj 1/1 Running 0 43s 172.17.125.40 k8s-node01 <none> <none> hostname-test-cby-86df45bf-jt2rz 1/1 Running 0 43s 172.27.14.236 k8s-node02 <none> <none> hostname-test-cby-86df45bf-s5jjn 1/1 Running 0 43s 172.27.14.235 k8s-node02 <none> <none> hostname-test-cby-86df45bf-vfkbt 1/1 Running 0 43s 172.17.125.39 k8s-node01 <none> <none> hostname-test-cby-86df45bf-z2x2b 1/1 Running 0 43s 172.27.14.234 k8s-node02 <none> <none> root@hello:~# 进入pod进行检查# 访问测试 root@hello:~# curl 172.17.125.38 123 root@hello:~# root@hello:~# kubectl exec hostname-test-cby-86df45bf-9fx5n -it -- /bin/bash root@hostname-test-cby-86df45bf-9fx5n:/# # 查看dns解析 root@hostname-test-cby-86df45bf-9fx5n:/# cat /etc/resolv.conf search default.svc.cluster.local svc.cluster.local cluster.local nameserver 10.96.0.10 options ndots:5 root@hostname-test-cby-86df45bf-9fx5n:/# # 查看host配置已生效 root@hostname-test-cby-86df45bf-9fx5n:/# cat /etc/hosts # Kubernetes-managed hosts file. 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet fe00::0 ip6-mcastprefix fe00::1 ip6-allnodes fe00::2 ip6-allrouters 172.27.14.197 hostname-test-cby-86df45bf-9fx5n # Entries added by HostAliases. 192.168.1.1 cby cby.chenby.cn 192.168.1.10 chenby chenby.chenby.cn root@hostname-test-cby-86df45bf-9fx5n:/# # 查看环境变量 root@hostname-test-cby-86df45bf-9fx5n:/# echo $cby chenby root@hostname-test-cby-86df45bf-9fx5n:/# https://www.oiox.cn/https://www.chenby.cn/https://cby-chen.github.io/https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://cloud.tencent.com/developer/column/93230https://www.jianshu.com/u/0f894314ae2chttps://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》文章主要发布于微信公众号:《Linux运维交流社区》
2022年05月18日
435 阅读
0 评论
0 点赞
2022-05-17
kubernetes (k8s) v1.24.0 安装dashboard面板
kubernetes (k8s) v1.24.0 安装dashboard面板介绍v1.24.0 使用之前的安装方式,在安装过程中会有一些异常,此文档已修复已知问题。下载所需配置root@k8s-master01:~# wget https://raw.githubusercontent.com/cby-chen/Kubernetes/main/yaml/dashboard.yaml root@k8s-master01:~# root@k8s-master01:~# kubectl apply -f dashboard.yaml namespace/kubernetes-dashboard unchanged serviceaccount/kubernetes-dashboard unchanged service/kubernetes-dashboard configured secret/kubernetes-dashboard-certs unchanged secret/kubernetes-dashboard-csrf configured Warning: resource secrets/kubernetes-dashboard-key-holder is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. secret/kubernetes-dashboard-key-holder configured configmap/kubernetes-dashboard-settings unchanged role.rbac.authorization.k8s.io/kubernetes-dashboard unchanged clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard unchanged rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard unchanged clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard unchanged deployment.apps/kubernetes-dashboard configured service/dashboard-metrics-scraper unchanged deployment.apps/dashboard-metrics-scraper unchanged root@k8s-master01:~# wget https://raw.githubusercontent.com/cby-chen/Kubernetes/main/yaml/dashboard-user.yaml root@k8s-master01:~# kubectl apply -f dashboard-user.yaml serviceaccount/admin-user created clusterrolebinding.rbac.authorization.k8s.io/admin-user created root@k8s-master01:~# 修改为nodePortroot@k8s-master01:~# kubectl edit svc kubernetes-dashboard -n kubernetes-dashboard service/kubernetes-dashboard edited root@k8s-master01:~# kubectl get svc kubernetes-dashboard -n kubernetes-dashboard NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes-dashboard NodePort 10.96.221.8 <none> 443:32721/TCP 74s root@k8s-master01:~# 创建tokenroot@k8s-master01:~# kubectl -n kubernetes-dashboard create token admin-user eyJhbGciOiJSUzI1NiIsImtpZCI6IlV6b3NRbDRiTll4VEl1a1VGbU53M2Y2X044Wjdfa21mQ0dfYk5BWktHRjAifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNjUyNzYzMjUzLCJpYXQiOjE2NTI3NTk2NTMsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsInNlcnZpY2VhY2NvdW50Ijp7Im5hbWUiOiJhZG1pbi11c2VyIiwidWlkIjoiNDYxYjc4MDItNTgzMS00MTNmLTg2M2ItODdlZWVkOTI3MTdiIn19LCJuYmYiOjE2NTI3NTk2NTMsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDphZG1pbi11c2VyIn0.nFF729zlDxz4Ed3fcVk5BE8Akc6jod6akf2rksVGJHmfurY7NO1nHP4EekrMx1FRa2JfoPOHTdxcWDVaQAymDC4vgP5aW5RCEOURUY6YdTQUxleRiX-Bgp3eNRHNOcPvdedGm0w7M7gnZqCwy4tsgyiXkIM7zZpvCqdCA1vGJxf_UIck4R8Izua5NSacnG25miIvAmxNzOAEHDD_jDIDHnPVi3iVZzrjBkDwG6spYx_yJbbLy1XbJCYMMH44X4ajuQulV_NS-aiIHj_-PbxfrBRAJCVTZ8L3zD14BraeAAHFqSoiLXohmYHLLjshtraVu4XcvehJDfnRMi8Y4b6sqA https://192.168.1.31:32721/ https://www.oiox.cn/ https://www.chenby.cn/ https://cby-chen.github.io/ https://blog.csdn.net/qq_33921750 https://my.oschina.net/u/3981543 https://www.zhihu.com/people/chen-bu-yun-2 https://segmentfault.com/u/hppyvyv6/articles https://juejin.cn/user/3315782802482007 https://cloud.tencent.com/developer/column/93230 https://www.jianshu.com/u/0f894314ae2c https://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/ CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》 文章主要发布于微信公众号:《Linux运维交流社区》
2022年05月17日
675 阅读
0 评论
0 点赞
2022-05-12
使用kubeadm初始化IPV4/IPV6集群
使用kubeadm初始化IPV4/IPV6集群图片CentOS 配置YUM源cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=kubernetes baseurl=https://mirrors.ustc.edu.cn/kubernetes/yum/repos/kubernetes-el7-$basearch enabled=1 EOF setenforce 0 yum install -y kubelet kubeadm kubectl # 如安装老版本 # yum install kubelet-1.16.9-0 kubeadm-1.16.9-0 kubectl-1.16.9-0 systemctl enable kubelet && systemctl start kubelet # 将 SELinux 设置为 permissive 模式(相当于将其禁用) sudo setenforce 0 sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config sudo systemctl enable --now kubelet Ubuntu 配置APT源curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb https://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main EOF apt-get update apt-get install -y kubelet kubeadm kubectl # 如安装老版本 # apt install kubelet=1.23.6-00 kubeadm=1.23.6-00 kubectl=1.23.6-00 配置containerdwget https://github.com/containerd/containerd/releases/download/v1.6.4/cri-containerd-cni-1.6.4-linux-amd64.tar.gz #解压 tar -C / -xzf cri-containerd-cni-1.6.4-linux-amd64.tar.gz #创建服务启动文件 cat > /etc/systemd/system/containerd.service <<EOF [Unit] Description=containerd container runtime Documentation=https://containerd.io After=network.target local-fs.target [Service] ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/local/bin/containerd Type=notify Delegate=yes KillMode=process Restart=always RestartSec=5 LimitNPROC=infinity LimitCORE=infinity LimitNOFILE=infinity TasksMax=infinity OOMScoreAdjust=-999 [Install] WantedBy=multi-user.target EOF mkdir -p /etc/containerd containerd config default | tee /etc/containerd/config.toml sed -i "s#SystemdCgroup\ \=\ false#SystemdCgroup\ \=\ true#g" /etc/containerd/config.toml sed -i "s#k8s.gcr.io#registry.cn-hangzhou.aliyuncs.com/chenby#g" /etc/containerd/config.toml systemctl daemon-reload systemctl enable --now containerd 配置基础环境cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf br_netfilter EOF cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-iptables = 1 fs.may_detach_mounts = 1 vm.overcommit_memory=1 vm.panic_on_oom=0 fs.inotify.max_user_watches=89100 fs.file-max=52706963 fs.nr_open=52706963 net.netfilter.nf_conntrack_max=2310720 net.ipv4.tcp_keepalive_time = 600 net.ipv4.tcp_keepalive_probes = 3 net.ipv4.tcp_keepalive_intvl =15 net.ipv4.tcp_max_tw_buckets = 36000 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_max_orphans = 327680 net.ipv4.tcp_orphan_retries = 3 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.ip_conntrack_max = 65536 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_timestamps = 0 net.core.somaxconn = 16384 net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0 net.ipv6.conf.all.forwarding = 1 EOF modprobe br_netfilter sudo sysctl --system hostnamectl set-hostname k8s-master01 hostnamectl set-hostname k8s-node01 hostnamectl set-hostname k8s-node02 sed -ri 's/.*swap.*/#&/' /etc/fstab swapoff -a && sysctl -w vm.swappiness=0 cat /etc/fstab cat > /etc/hosts <<EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 2408:8207:78ce:7561::21 k8s-master01 2408:8207:78ce:7561::22 k8s-node01 2408:8207:78ce:7561::23 k8s-node02 10.0.0.21 k8s-master01 10.0.0.22 k8s-node01 10.0.0.23 k8s-node02 EOF 初始化安装root@k8s-master01:~# kubeadm config images list --image-repository registry.cn-hangzhou.aliyuncs.com/chenby registry.cn-hangzhou.aliyuncs.com/chenby/kube-apiserver:v1.24.0 registry.cn-hangzhou.aliyuncs.com/chenby/kube-controller-manager:v1.24.0 registry.cn-hangzhou.aliyuncs.com/chenby/kube-scheduler:v1.24.0 registry.cn-hangzhou.aliyuncs.com/chenby/kube-proxy:v1.24.0 registry.cn-hangzhou.aliyuncs.com/chenby/pause:3.7 registry.cn-hangzhou.aliyuncs.com/chenby/etcd:3.5.3-0 registry.cn-hangzhou.aliyuncs.com/chenby/coredns:v1.8.6 root@k8s-master01:~# vim kubeadm.yaml root@k8s-master01:~# cat kubeadm.yaml apiVersion: kubeadm.k8s.io/v1beta3 kind: InitConfiguration localAPIEndpoint: advertiseAddress: "10.0.0.21" bindPort: 6443 nodeRegistration: taints: - effect: PreferNoSchedule key: node-role.kubernetes.io/master --- apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration kubernetesVersion: v1.24.0 imageRepository: registry.cn-hangzhou.aliyuncs.com/chenby networking: podSubnet: 172.16.0.0/12,fc00::/48 serviceSubnet: 10.96.0.0/12,fd00::/108 root@k8s-master01:~# root@k8s-master01:~# root@k8s-master01:~# kubeadm init --config=kubeadm.yaml [init] Using Kubernetes version: v1.24.0 [preflight] Running pre-flight checks [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' [certs] Using certificateDir folder "/etc/kubernetes/pki" [certs] Generating "ca" certificate and key [certs] Generating "apiserver" certificate and key [certs] apiserver serving cert is signed for DNS names [k8s-master01 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.0.0.21] [certs] Generating "apiserver-kubelet-client" certificate and key [certs] Generating "front-proxy-ca" certificate and key [certs] Generating "front-proxy-client" certificate and key [certs] Generating "etcd/ca" certificate and key [certs] Generating "etcd/server" certificate and key [certs] etcd/server serving cert is signed for DNS names [k8s-master01 localhost] and IPs [10.0.0.21 127.0.0.1 ::1] [certs] Generating "etcd/peer" certificate and key [certs] etcd/peer serving cert is signed for DNS names [k8s-master01 localhost] and IPs [10.0.0.21 127.0.0.1 ::1] [certs] Generating "etcd/healthcheck-client" certificate and key [certs] Generating "apiserver-etcd-client" certificate and key [certs] Generating "sa" key and public key [kubeconfig] Using kubeconfig folder "/etc/kubernetes" [kubeconfig] Writing "admin.conf" kubeconfig file [kubeconfig] Writing "kubelet.conf" kubeconfig file [kubeconfig] Writing "controller-manager.conf" kubeconfig file [kubeconfig] Writing "scheduler.conf" kubeconfig file [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" [control-plane] Creating static Pod manifest for "kube-controller-manager" [control-plane] Creating static Pod manifest for "kube-scheduler" [etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests" [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.504341 seconds [upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace [kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster [upload-certs] Skipping phase. Please see --upload-certs [mark-control-plane] Marking the node k8s-master01 as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers] [mark-control-plane] Marking the node k8s-master01 as control-plane by adding the taints [node-role.kubernetes.io/master:PreferNoSchedule] [bootstrap-token] Using token: lnodkp.3n8i4m33sqwg39w2 [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 [kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key [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 10.0.0.21:6443 --token lnodkp.3n8i4m33sqwg39w2 \ --discovery-token-ca-cert-hash sha256:0ed7e18ea2b49bb599bc45e72f764bbe034ef1dce47729f2722467c167754da8 root@k8s-master01:~# root@k8s-master01:~# mkdir -p $HOME/.kube root@k8s-master01:~# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config root@k8s-master01:~# sudo chown $(id -u):$(id -g) $HOME/.kube/config root@k8s-master01:~# root@k8s-node01:~# kubeadm join 10.0.0.21:6443 --token qf3z22.qwtqieutbkik6dy4 \ > --discovery-token-ca-cert-hash sha256:2ade8c834a41cc1960993a600c89fa4bb86e3594f82e09bcd42633d4defbda0d [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster. root@k8s-node01:~# root@k8s-node02:~# kubeadm join 10.0.0.21:6443 --token qf3z22.qwtqieutbkik6dy4 \ > --discovery-token-ca-cert-hash sha256:2ade8c834a41cc1960993a600c89fa4bb86e3594f82e09bcd42633d4defbda0d [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster. root@k8s-node02:~# 查看集群root@k8s-master01:~# kubectl get node NAME STATUS ROLES AGE VERSION k8s-master01 Ready control-plane 111s v1.24.0 k8s-node01 Ready <none> 82s v1.24.0 k8s-node02 Ready <none> 92s v1.24.0 root@k8s-master01:~# root@k8s-master01:~# root@k8s-master01:~# kubectl get pod -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-bc77466fc-jxkpv 1/1 Running 0 83s kube-system coredns-bc77466fc-nrc9l 1/1 Running 0 83s kube-system etcd-k8s-master01 1/1 Running 0 87s kube-system kube-apiserver-k8s-master01 1/1 Running 0 89s kube-system kube-controller-manager-k8s-master01 1/1 Running 0 87s kube-system kube-proxy-2lgrn 1/1 Running 0 83s kube-system kube-proxy-69p9r 1/1 Running 0 47s kube-system kube-proxy-g58m2 1/1 Running 0 42s kube-system kube-scheduler-k8s-master01 1/1 Running 0 87s root@k8s-master01:~# 配置calicowget https://raw.githubusercontent.com/cby-chen/Kubernetes/main/yaml/calico-ipv6.yaml # vim calico-ipv6.yaml # calico-config ConfigMap处 "ipam": { "type": "calico-ipam", "assign_ipv4": "true", "assign_ipv6": "true" }, - name: IP value: "autodetect" - name: IP6 value: "autodetect" - name: CALICO_IPV4POOL_CIDR value: "172.16.0.0/16" - name: CALICO_IPV6POOL_CIDR value: "fc00::/48" - name: FELIX_IPV6SUPPORT value: "true" kubectl apply -f calico-ipv6.yaml 测试IPV6root@k8s-master01:~# cat cby.yaml apiVersion: apps/v1 kind: Deployment metadata: name: chenby spec: replicas: 3 selector: matchLabels: app: chenby template: metadata: labels: app: chenby spec: containers: - name: chenby image: nginx resources: limits: memory: "128Mi" cpu: "500m" ports: - containerPort: 80 --- apiVersion: v1 kind: Service metadata: name: chenby spec: ipFamilyPolicy: PreferDualStack ipFamilies: - IPv6 - IPv4 type: NodePort selector: app: chenby ports: - port: 80 targetPort: 80 kubectl apply -f cby.yaml root@k8s-master01:~# kubectl get pod NAME READY STATUS RESTARTS AGE chenby-57479d5997-6pfzg 1/1 Running 0 6m chenby-57479d5997-jjwpk 1/1 Running 0 6m chenby-57479d5997-pzrkc 1/1 Running 0 6m root@k8s-master01:~# kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE chenby NodePort fd00::f816 <none> 80:30265/TCP 6m7s kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 168m root@k8s-master01:~# curl -I http://[2408:8207:78ce:7561::21]:30265/ HTTP/1.1 200 OK Server: nginx/1.21.6 Date: Wed, 11 May 2022 07:01:43 GMT Content-Type: text/html Content-Length: 615 Last-Modified: Tue, 25 Jan 2022 15:03:52 GMT Connection: keep-alive ETag: "61f01158-267" Accept-Ranges: bytes root@k8s-master01:~# curl -I http://10.0.0.21:30265/ HTTP/1.1 200 OK Server: nginx/1.21.6 Date: Wed, 11 May 2022 07:01:54 GMT Content-Type: text/html Content-Length: 615 Last-Modified: Tue, 25 Jan 2022 15:03:52 GMT Connection: keep-alive ETag: "61f01158-267" Accept-Ranges: bytes https://www.oiox.cn/https://www.chenby.cn/https://blog.oiox.cn/https://cby-chen.github.io/https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://cloud.tencent.com/developer/column/93230https://www.jianshu.com/u/0f894314ae2chttps://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》文章主要发布于微信公众号:《Linux运维交流社区》本文使用 文章同步助手 同步
2022年05月12日
403 阅读
6 评论
0 点赞
2022-05-11
部署kubernetes官网博客
部署kubernetes官网博客访问 https://kubernetes.io/ 有些时候不问题,部署离线内网使用官网以及博客, 各位尝鲜可以访问 https://doc.oiox.cn/安装dockerroot@cby:~# curl -sSL https://get.daocloud.io/docker | sh # Executing docker install script, commit: 0221adedb4bcde0f3d18bddda023544fc56c29d1 + sh -c apt-get update -qq >/dev/null + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null + sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg + sh -c chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg + sh -c echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list + sh -c apt-get update -qq >/dev/null + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli docker-compose-plugin docker-scan-plugin >/dev/null + version_gte 20.10 + [ -z ] + return 0 + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null + sh -c docker version Client: Docker Engine - Community Version: 20.10.15 API version: 1.41 Go version: go1.17.9 Git commit: fd82621 Built: Thu May 5 13:19:23 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.15 API version: 1.41 (minimum version 1.12) Go version: go1.17.9 Git commit: 4433bf6 Built: Thu May 5 13:17:28 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.4 GitCommit: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16 runc: Version: 1.1.1 GitCommit: v1.1.1-0-g52de29d docker-init: Version: 0.19.0 GitCommit: de40ad0 ================================================================================ To run Docker as a non-privileged user, consider setting up the Docker daemon in rootless mode for your user: dockerd-rootless-setuptool.sh install Visit https://docs.docker.com/go/rootless/ to learn about rootless mode. To run the Docker daemon as a fully privileged service, but granting non-root users access, refer to https://docs.docker.com/go/daemon-access/ WARNING: Access to the remote API on a privileged Docker daemon is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' documentation for details: https://docs.docker.com/go/attack-surface/ ================================================================================ root@cby:~# 克隆库root@cby:~# git clone https://github.com/kubernetes/website.git Cloning into 'website'... remote: Enumerating objects: 269472, done. remote: Counting objects: 100% (354/354), done. remote: Compressing objects: 100% (240/240), done. remote: Total 269472 (delta 201), reused 221 (delta 112), pack-reused 269118 Receiving objects: 100% (269472/269472), 334.98 MiB | 1.92 MiB/s, done. Resolving deltas: 100% (190520/190520), done. Updating files: 100% (7124/7124), done. root@cby:~# cd website root@cby:~/website# 安装依赖root@cby:~/website# git submodule update --init --recursive --depth 1 Submodule 'api-ref-generator' (https://github.com/kubernetes-sigs/reference-docs) registered for path 'api-ref-generator' Submodule 'themes/docsy' (https://github.com/google/docsy.git) registered for path 'themes/docsy' Cloning into '/root/website/api-ref-generator'... Cloning into '/root/website/themes/docsy'... remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 104, done. remote: Counting objects: 100% (104/104), done. remote: Compressing objects: 100% (53/53), done. remote: Total 61 (delta 34), reused 23 (delta 6), pack-reused 0 Unpacking objects: 100% (61/61), 103.64 KiB | 252.00 KiB/s, done. From https://github.com/kubernetes-sigs/reference-docs * branch 55bce686224caba37f93e1e1eb53c0c9fc104ed4 -> FETCH_HEAD Submodule path 'api-ref-generator': checked out '55bce686224caba37f93e1e1eb53c0c9fc104ed4' Submodule 'themes/docsy' (https://github.com/google/docsy.git) registered for path 'api-ref-generator/themes/docsy' Cloning into '/root/website/api-ref-generator/themes/docsy'... remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 251, done. remote: Counting objects: 100% (251/251), done. remote: Compressing objects: 100% (119/119), done. remote: Total 130 (delta 82), reused 34 (delta 3), pack-reused 0 Receiving objects: 100% (130/130), 43.96 KiB | 308.00 KiB/s, done. Resolving deltas: 100% (82/82), completed with 77 local objects. From https://github.com/google/docsy * branch 6b30513dc837c5937de351f2fb2e4fedb04365c4 -> FETCH_HEAD Submodule path 'api-ref-generator/themes/docsy': checked out '6b30513dc837c5937de351f2fb2e4fedb04365c4' Submodule 'assets/vendor/Font-Awesome' (https://github.com/FortAwesome/Font-Awesome.git) registered for path 'api-ref-generator/themes/docsy/assets/vendor/Font-Awesome' Submodule 'assets/vendor/bootstrap' (https://github.com/twbs/bootstrap.git) registered for path 'api-ref-generator/themes/docsy/assets/vendor/bootstrap' Cloning into '/root/website/api-ref-generator/themes/docsy/assets/vendor/Font-Awesome'... Cloning into '/root/website/api-ref-generator/themes/docsy/assets/vendor/bootstrap'... remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 8924, done. remote: Counting objects: 100% (8921/8921), done. remote: Compressing objects: 100% (2868/2868), done. remote: Total 4847 (delta 3027), reused 2286 (delta 1978), pack-reused 0 Receiving objects: 100% (4847/4847), 5.77 MiB | 4.38 MiB/s, done. Resolving deltas: 100% (3027/3027), completed with 884 local objects. From https://github.com/FortAwesome/Font-Awesome * branch fcec2d1b01ff069ac10500ac42e4478d20d21f4c -> FETCH_HEAD Submodule path 'api-ref-generator/themes/docsy/assets/vendor/Font-Awesome': checked out 'fcec2d1b01ff069ac10500ac42e4478d20d21f4c' remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 701, done. remote: Counting objects: 100% (701/701), done. remote: Compressing objects: 100% (511/511), done. remote: Total 528 (delta 115), reused 186 (delta 13), pack-reused 0 Receiving objects: 100% (528/528), 2.01 MiB | 5.52 MiB/s, done. Resolving deltas: 100% (115/115), completed with 73 local objects. From https://github.com/twbs/bootstrap * branch a716fb03f965dc0846df479e14388b1b4b93d7ce -> FETCH_HEAD Submodule path 'api-ref-generator/themes/docsy/assets/vendor/bootstrap': checked out 'a716fb03f965dc0846df479e14388b1b4b93d7ce' remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 76, done. remote: Counting objects: 100% (76/76), done. remote: Compressing objects: 100% (37/37), done. remote: Total 39 (delta 30), reused 6 (delta 0), pack-reused 0 Unpacking objects: 100% (39/39), 4.48 KiB | 654.00 KiB/s, done. From https://github.com/google/docsy * branch 1c77bb24483946f11c13f882f836a940b55ad019 -> FETCH_HEAD Submodule path 'themes/docsy': checked out '1c77bb24483946f11c13f882f836a940b55ad019' Submodule 'assets/vendor/Font-Awesome' (https://github.com/FortAwesome/Font-Awesome.git) registered for path 'themes/docsy/assets/vendor/Font-Awesome' Submodule 'assets/vendor/bootstrap' (https://github.com/twbs/bootstrap.git) registered for path 'themes/docsy/assets/vendor/bootstrap' Cloning into '/root/website/themes/docsy/assets/vendor/Font-Awesome'... Cloning into '/root/website/themes/docsy/assets/vendor/bootstrap'... remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 8925, done. remote: Counting objects: 100% (8922/8922), done. remote: Compressing objects: 100% (2801/2801), done. remote: Total 4848 (delta 3031), reused 2433 (delta 2046), pack-reused 0 Receiving objects: 100% (4848/4848), 5.65 MiB | 4.21 MiB/s, done. Resolving deltas: 100% (3031/3031), completed with 855 local objects. From https://github.com/FortAwesome/Font-Awesome * branch 7d3d774145ac38663f6d1effc6def0334b68ab7e -> FETCH_HEAD Submodule path 'themes/docsy/assets/vendor/Font-Awesome': checked out '7d3d774145ac38663f6d1effc6def0334b68ab7e' remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Enumerating objects: 770, done. remote: Counting objects: 100% (770/770), done. remote: Compressing objects: 100% (497/497), done. remote: Total 524 (delta 161), reused 183 (delta 19), pack-reused 0 Receiving objects: 100% (524/524), 2.01 MiB | 2.53 MiB/s, done. Resolving deltas: 100% (161/161), completed with 122 local objects. From https://github.com/twbs/bootstrap * branch 043a03c95a2ad6738f85b65e53b9dbdfb03b8d10 -> FETCH_HEAD Submodule path 'themes/docsy/assets/vendor/bootstrap': checked out '043a03c95a2ad6738f85b65e53b9dbdfb03b8d10' root@cby:~/website# 构建镜像root@cby:~/website# make container-image docker build . \ --network=host \ --tag gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c \ --build-arg HUGO_VERSION=0.87.0 Sending build context to Docker daemon 4.096kB Step 1/12 : FROM golang:1.16-alpine 1.16-alpine: Pulling from library/golang 59bf1c3509f3: Pull complete 666ba61612fd: Pull complete 8ed8ca486205: Pull complete ca4bf87e467a: Pull complete 0435e0963794: Pull complete Digest: sha256:5616dca835fa90ef13a843824ba58394dad356b7d56198fb7c93cbe76d7d67fe Status: Downloaded newer image for golang:1.16-alpine ---> 7642119cd161 Step 2/12 : LABEL maintainer="Luc Perkins <lperkins@linuxfoundation.org>" ---> Running in f6a8d1fa0c42 Removing intermediate container f6a8d1fa0c42 ---> 291fd45ae748 Step 3/12 : RUN apk add --no-cache curl gcc g++ musl-dev build-base libc6-compat ---> Running in 209e30a852d3 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz (1/25) Installing libgcc (10.3.1_git20211027-r0) (2/25) Installing libstdc++ (10.3.1_git20211027-r0) (3/25) Installing binutils (2.37-r3) (4/25) Installing libmagic (5.41-r0) (5/25) Installing file (5.41-r0) (6/25) Installing libgomp (10.3.1_git20211027-r0) (7/25) Installing libatomic (10.3.1_git20211027-r0) (8/25) Installing libgphobos (10.3.1_git20211027-r0) (9/25) Installing gmp (6.2.1-r1) (10/25) Installing isl22 (0.22-r0) (11/25) Installing mpfr4 (4.1.0-r0) (12/25) Installing mpc1 (1.2.1-r0) (13/25) Installing gcc (10.3.1_git20211027-r0) (14/25) Installing musl-dev (1.2.2-r7) (15/25) Installing libc-dev (0.7.2-r3) (16/25) Installing g++ (10.3.1_git20211027-r0) (17/25) Installing make (4.3-r0) (18/25) Installing fortify-headers (1.1-r1) (19/25) Installing patch (2.7.6-r7) (20/25) Installing build-base (0.5-r2) (21/25) Installing brotli-libs (1.0.9-r5) (22/25) Installing nghttp2-libs (1.46.0-r0) (23/25) Installing libcurl (7.80.0-r1) (24/25) Installing curl (7.80.0-r1) (25/25) Installing libc6-compat (1.2.2-r7) Executing busybox-1.34.1-r3.trigger OK: 198 MiB in 40 packages Removing intermediate container 209e30a852d3 ---> 83dfeba4ff34 Step 4/12 : ARG HUGO_VERSION ---> Running in fdbe162165c2 Removing intermediate container fdbe162165c2 ---> d6219e970f50 Step 5/12 : RUN mkdir $HOME/src && cd $HOME/src && curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz && cd "hugo-${HUGO_VERSION}" && go install --tags extended ---> Running in fe0b26ed3841 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 100 35.2M 0 35.2M 0 0 2216k 0 --:--:-- 0:00:16 --:--:-- 3037k go: downloading github.com/alecthomas/chroma v0.9.2 go: downloading github.com/bep/debounce v1.2.0 go: downloading github.com/fsnotify/fsnotify v1.4.9 go: downloading github.com/pkg/errors v0.9.1 go: downloading github.com/spf13/afero v1.6.0 go: downloading github.com/spf13/cobra v1.2.1 go: downloading github.com/spf13/fsync v0.9.0 go: downloading github.com/spf13/jwalterweatherman v1.1.0 go: downloading github.com/spf13/pflag v1.0.5 go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c go: downloading github.com/pelletier/go-toml v1.9.3 go: downloading github.com/spf13/cast v1.4.0 go: downloading github.com/PuerkitoBio/purell v1.1.1 go: downloading github.com/gobwas/glob v0.2.3 go: downloading github.com/mattn/go-isatty v0.0.13 go: downloading github.com/mitchellh/mapstructure v1.4.1 go: downloading github.com/aws/aws-sdk-go v1.40.8 go: downloading github.com/dustin/go-humanize v1.0.0 go: downloading gocloud.dev v0.20.0 go: downloading github.com/pelletier/go-toml/v2 v2.0.0-beta.3.0.20210727221244-fa0796069526 go: downloading golang.org/x/text v0.3.6 go: downloading google.golang.org/api v0.51.0 go: downloading github.com/jdkato/prose v1.2.1 go: downloading github.com/kyokomi/emoji/v2 v2.2.8 go: downloading github.com/mitchellh/hashstructure v1.1.0 go: downloading github.com/olekukonko/tablewriter v0.0.5 go: downloading github.com/armon/go-radix v1.0.0 go: downloading github.com/gohugoio/locales v0.14.0 go: downloading github.com/gohugoio/localescompressed v0.14.0 go: downloading github.com/gorilla/websocket v1.4.2 go: downloading github.com/rogpeppe/go-internal v1.8.0 go: downloading gopkg.in/yaml.v2 v2.4.0 go: downloading github.com/niklasfasching/go-org v1.5.0 go: downloading github.com/bep/gitmap v1.1.2 go: downloading github.com/gobuffalo/flect v0.2.3 go: downloading golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0 go: downloading github.com/cli/safeexec v1.0.0 go: downloading github.com/dlclark/regexp2 v1.4.0 go: downloading github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69 go: downloading github.com/disintegration/gift v1.2.1 go: downloading golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 go: downloading golang.org/x/net v0.0.0-20210614182718-04defd469f4e go: downloading go.opencensus.io v0.23.0 go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 go: downloading github.com/Azure/azure-pipeline-go v0.2.2 go: downloading github.com/Azure/azure-storage-blob-go v0.9.0 go: downloading github.com/google/uuid v1.1.2 go: downloading github.com/google/wire v0.4.0 go: downloading cloud.google.com/go v0.87.0 go: downloading github.com/googleapis/gax-go v2.0.2+incompatible go: downloading github.com/googleapis/gax-go/v2 v2.0.5 go: downloading cloud.google.com/go/storage v1.10.0 go: downloading golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 go: downloading google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea go: downloading github.com/mattn/go-runewidth v0.0.9 go: downloading github.com/bep/tmc v0.5.1 go: downloading github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd go: downloading github.com/gohugoio/go-i18n/v2 v2.1.3-0.20210430103248-4c28c89f8013 go: downloading github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6 go: downloading github.com/bep/gowebp v0.1.0 go: downloading github.com/muesli/smartcrop v0.3.0 go: downloading google.golang.org/grpc v1.39.0 go: downloading github.com/mattn/go-ieproxy v0.0.1 go: downloading github.com/russross/blackfriday/v2 v2.0.1 go: downloading google.golang.org/protobuf v1.27.1 go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 go: downloading github.com/yuin/goldmark v1.4.0 go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691 go: downloading github.com/miekg/mmark v1.3.6 go: downloading github.com/tdewolff/minify/v2 v2.9.21 go: downloading github.com/sanity-io/litter v1.5.1 go: downloading github.com/getkin/kin-openapi v0.68.0 go: downloading github.com/ghodss/yaml v1.0.0 go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0 go: downloading github.com/jmespath/go-jmespath v0.4.0 go: downloading github.com/BurntSushi/toml v0.3.1 go: downloading github.com/evanw/esbuild v0.12.17 go: downloading github.com/tdewolff/parse/v2 v2.5.19 go: downloading github.com/bep/godartsass v0.12.0 go: downloading github.com/bep/golibsass v1.0.0 go: downloading github.com/golang/protobuf v1.5.2 go: downloading github.com/google/go-cmp v0.5.6 go: downloading github.com/go-openapi/jsonpointer v0.19.5 go: downloading github.com/go-openapi/swag v0.19.5 go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e Removing intermediate container fe0b26ed3841 ---> 034cde1adc00 Step 6/12 : FROM golang:1.16-alpine ---> 7642119cd161 Step 7/12 : RUN apk add --no-cache runuser git openssh-client rsync npm && npm install -D autoprefixer postcss-cli ---> Running in 2af5902e5287 fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz (1/27) Installing brotli-libs (1.0.9-r5) (2/27) Installing nghttp2-libs (1.46.0-r0) (3/27) Installing libcurl (7.80.0-r1) (4/27) Installing expat (2.4.7-r0) (5/27) Installing pcre2 (10.39-r0) (6/27) Installing git (2.34.2-r0) (7/27) Installing c-ares (1.18.1-r0) (8/27) Installing libgcc (10.3.1_git20211027-r0) (9/27) Installing libstdc++ (10.3.1_git20211027-r0) (10/27) Installing icu-libs (69.1-r1) (11/27) Installing libuv (1.42.0-r0) (12/27) Installing nodejs-current (17.9.0-r0) (13/27) Installing npm (8.1.3-r0) (14/27) Installing openssh-keygen (8.8_p1-r1) (15/27) Installing ncurses-terminfo-base (6.3_p20211120-r0) (16/27) Installing ncurses-libs (6.3_p20211120-r0) (17/27) Installing libedit (20210910.3.1-r0) (18/27) Installing openssh-client-common (8.8_p1-r1) (19/27) Installing openssh-client-default (8.8_p1-r1) (20/27) Installing libacl (2.2.53-r0) (21/27) Installing lz4-libs (1.9.3-r1) (22/27) Installing popt (1.18-r0) (23/27) Installing zstd-libs (1.5.0-r0) (24/27) Installing rsync (3.2.3-r5) (25/27) Installing libeconf (0.4.2-r0) (26/27) Installing linux-pam (1.5.2-r0) (27/27) Installing runuser (2.37.4-r0) Executing busybox-1.34.1-r3.trigger OK: 106 MiB in 42 packages added 73 packages, and audited 74 packages in 15s 17 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Removing intermediate container 2af5902e5287 ---> 620ef2580a98 Step 8/12 : RUN mkdir -p /var/hugo && addgroup -Sg 1000 hugo && adduser -Sg hugo -u 1000 -h /var/hugo hugo && chown -R hugo: /var/hugo && runuser -u hugo -- git config --global --add safe.directory /src ---> Running in dc169979de70 Removing intermediate container dc169979de70 ---> 1006a4277115 Step 9/12 : COPY --from=0 /go/bin/hugo /usr/local/bin/hugo ---> 9bd8581cf0c3 Step 10/12 : WORKDIR /src ---> Running in 89fb367fe208 Removing intermediate container 89fb367fe208 ---> b299d26f87a7 Step 11/12 : USER hugo:hugo ---> Running in 353a5aec3b6e Removing intermediate container 353a5aec3b6e ---> ec88a8ce29a5 Step 12/12 : EXPOSE 1313 ---> Running in 2649b06d597f Removing intermediate container 2649b06d597f ---> 20b483234fde Successfully built 20b483234fde Successfully tagged gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c root@cby:~/website# 构建容器root@cby:~/website# make container-serve docker run --rm --interactive --tty --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir Start building sites … hugo v0.87.0+extended linux/amd64 BuildDate=unknown ---- | EN | ZH | KO | JA | FR | IT | DE | ES | PT-BR | ID | RU | VI | PL | UK -------------------+------+------+-----+-----+-----+-----+-----+-----+-------+-----+-----+-----+-----+------ Pages | 1453 | 1015 | 539 | 450 | 338 | 71 | 164 | 292 | 186 | 335 | 155 | 77 | 69 | 92 Paginator pages | 43 | 9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Non-page files | 509 | 386 | 200 | 266 | 73 | 20 | 17 | 33 | 30 | 105 | 24 | 8 | 6 | 20 Static files | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 | 838 Processed images | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Aliases | 8 | 2 | 3 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 Sitemaps | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 Cleaned | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Built in 15926 ms Watching for changes in /src/{archetypes,assets,content,data,i18n,layouts,package.json,postcss.config.js,static,themes} Watching for config changes in /src/config.toml, /src/themes/docsy/config.toml, /src/go.mod Environment: "development" Serving pages from /tmp/hugo Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender Web Server is available at http://localhost:1313/ (bind address 0.0.0.0) Press Ctrl+C to stop 后台启动root@cby:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE gcr.io/k8s-staging-sig-docs/k8s-website-hugo v0.87.0-c8ffb2b5979c 20b483234fde 4 minutes ago 501MB <none> <none> 034cde1adc00 4 minutes ago 1.8GB golang 1.16-alpine 7642119cd161 2 months ago 302MB root@cby:~# root@cby:~/website# docker run --rm --interactive -d --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir docker run --rm --interactive -d --volume /root/website:/src --cap-drop=ALL --cap-add=AUDIT_WRITE --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c hugo server --buildFuture --environment development --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir root@cby:~/website# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 06f34ad73c67 gcr.io/k8s-staging-sig-docs/k8s-website-hugo:v0.87.0-c8ffb2b5979c "hugo server --build…" 5 seconds ago Up 4 seconds 0.0.0.0:1313->1313/tcp, :::1313->1313/tcp nervous_kilby root@cby:~/website# 更新文档root@hello:~/website# git pull remote: Enumerating objects: 187, done. remote: Counting objects: 100% (181/181), done. remote: Compressing objects: 100% (112/112), done. remote: Total 187 (delta 107), reused 126 (delta 69), pack-reused 6 Receiving objects: 100% (187/187), 154.37 KiB | 403.00 KiB/s, done. Resolving deltas: 100% (107/107), completed with 35 local objects. From https://github.com/kubernetes/website f559e15074..07e1929b49 main -> origin/main 8c980f042b..68e621e794 dev-1.24-ko.1 -> origin/dev-1.24-ko.1 Updating f559e15074..07e1929b49 Fast-forward content/en/docs/concepts/cluster-administration/manage-deployment.md | 2 +- content/en/docs/concepts/containers/runtime-class.md | 2 +- content/en/docs/concepts/workloads/pods/init-containers.md | 1 - content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_generate-csr.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-certs.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_create.md | 1 - content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_delete.md | 3 --- content/en/docs/reference/setup-tools/kubeadm/generated/kubeadm_version.md | 3 --- content/en/docs/setup/production-environment/windows/intro-windows-in-kubernetes.md | 2 +- content/en/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes.md | 2 +- content/en/docs/tasks/configure-pod-container/configure-pod-initialization.md | 1 - content/en/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md | 2 +- content/pt-br/blog/_posts/2022-02-17-updated-dockershim-faq.md | 2 +- content/zh/docs/concepts/architecture/nodes.md | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------- content/zh/docs/concepts/cluster-administration/system-logs.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------- content/zh/docs/concepts/containers/runtime-class.md | 62 +++++++++++++++++++++----------------------------------------- content/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md | 111 +++++++++++++++++++++------------------------------------------------------------------------------------------ content/zh/docs/concepts/overview/kubernetes-api.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++---------------------- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_generate-csr.md | 26 ++++++++++++++++++++------ content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md | 28 +++++++++++++++++++++++++--- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-certs.md | 30 +++++++++++++++++++++++++++++- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join.md | 20 +++++++++++++++++++- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token.md | 24 +++++++++++++++++++++++- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_create.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_delete.md | 24 +++++++++++++++++++++++- content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_version.md | 24 +++++++++++++++++++++++- static/_redirects | 48 +++++++++++++++++++++++++++++++++--------------- 30 files changed, 539 insertions(+), 267 deletions(-) root@hello:~/website# https://www.oiox.cn/https://www.chenby.cn/https://blog.oiox.cn/https://cby-chen.github.io/https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://cloud.tencent.com/developer/column/93230https://www.jianshu.com/u/0f894314ae2chttps://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》文章主要发布于微信公众号:《Linux运维交流社区》
2022年05月11日
423 阅读
0 评论
0 点赞
2022-05-06
使用kubeadm快速启用一个集群
使用kubeadm快速启用一个集群CentOS 配置YUM源cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=kubernetes baseurl=https://mirrors.ustc.edu.cn/kubernetes/yum/repos/kubernetes-el7-$basearch enabled=1 EOF setenforce 0 yum install -y kubelet kubeadm kubectl systemctl enable kubelet && systemctl start kubelet # 将 SELinux 设置为 permissive 模式(相当于将其禁用) sudo setenforce 0 sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config sudo systemctl enable --now kubelet Ubuntu 配置APT源curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb https://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main EOF apt-get update apt-get install -y kubelet kubeadm kubectl 配置containerdwget https://github.com/containerd/containerd/releases/download/v1.6.4/cri-containerd-cni-1.6.4-linux-amd64.tar.gz #解压 tar -C / -xzf cri-containerd-cni-1.6.4-linux-amd64.tar.gz #创建服务启动文件 cat > /etc/systemd/system/containerd.service <<EOF [Unit] Description=containerd container runtime Documentation=https://containerd.io After=network.target local-fs.target [Service] ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/local/bin/containerd Type=notify Delegate=yes KillMode=process Restart=always RestartSec=5 LimitNPROC=infinity LimitCORE=infinity LimitNOFILE=infinity TasksMax=infinity OOMScoreAdjust=-999 [Install] WantedBy=multi-user.target EOF mkdir -p /etc/containerd containerd config default | tee /etc/containerd/config.toml sed -i "s#SystemdCgroup\ \=\ false#SystemdCgroup\ \=\ true#g" /etc/containerd/config.toml sed -i "s#k8s.gcr.io#registry.cn-hangzhou.aliyuncs.com/chenby#g" /etc/containerd/config.toml systemctl daemon-reload systemctl enable --now containerd 配置基础环境cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf br_netfilter EOF cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-iptables = 1 fs.may_detach_mounts = 1 vm.overcommit_memory=1 vm.panic_on_oom=0 fs.inotify.max_user_watches=89100 fs.file-max=52706963 fs.nr_open=52706963 net.netfilter.nf_conntrack_max=2310720 net.ipv4.tcp_keepalive_time = 600 net.ipv4.tcp_keepalive_probes = 3 net.ipv4.tcp_keepalive_intvl =15 net.ipv4.tcp_max_tw_buckets = 36000 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_max_orphans = 327680 net.ipv4.tcp_orphan_retries = 3 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.ip_conntrack_max = 65536 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_timestamps = 0 net.core.somaxconn = 16384 net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0 net.ipv6.conf.all.forwarding = 1 EOF modprobe br_netfilter sudo sysctl --system hostnamectl set-hostname k8s-master01 hostnamectl set-hostname k8s-node01 hostnamectl set-hostname k8s-node02 sed -ri 's/.*swap.*/#&/' /etc/fstab swapoff -a && sysctl -w vm.swappiness=0 cat /etc/fstab cat > /etc/hosts <<EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.31 k8s-master01 192.168.1.32 k8s-node01 192.168.1.33 k8s-node01 EOF 初始化安装root@k8s-master01:~# kubeadm config images missing subcommand; "images" is not meant to be run on its own To see the stack trace of this error execute with --v=5 or higher root@k8s-master01:~# kubeadm config images list k8s.gcr.io/kube-apiserver:v1.24.0 k8s.gcr.io/kube-controller-manager:v1.24.0 k8s.gcr.io/kube-scheduler:v1.24.0 k8s.gcr.io/kube-proxy:v1.24.0 k8s.gcr.io/pause:3.7 k8s.gcr.io/etcd:3.5.3-0 k8s.gcr.io/coredns/coredns:v1.8.6 root@k8s-master01:~# root@k8s-master01:~# root@k8s-master01:~# root@k8s-master01:~# kubeadm init --image-repository registry.cn-hangzhou.aliyuncs.com/chenby [init] Using Kubernetes version: v1.24.0 [preflight] Running pre-flight checks [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' [certs] Using certificateDir folder "/etc/kubernetes/pki" [certs] Generating "ca" certificate and key [certs] Generating "apiserver" certificate and key [certs] apiserver serving cert is signed for DNS names [k8s-master01 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.1.31] [certs] Generating "apiserver-kubelet-client" certificate and key [certs] Generating "front-proxy-ca" certificate and key [certs] Generating "front-proxy-client" certificate and key [certs] Generating "etcd/ca" certificate and key [certs] Generating "etcd/server" certificate and key [certs] etcd/server serving cert is signed for DNS names [k8s-master01 localhost] and IPs [192.168.1.31 127.0.0.1 ::1] [certs] Generating "etcd/peer" certificate and key [certs] etcd/peer serving cert is signed for DNS names [k8s-master01 localhost] and IPs [192.168.1.31 127.0.0.1 ::1] [certs] Generating "etcd/healthcheck-client" certificate and key [certs] Generating "apiserver-etcd-client" certificate and key [certs] Generating "sa" key and public key [kubeconfig] Using kubeconfig folder "/etc/kubernetes" [kubeconfig] Writing "admin.conf" kubeconfig file [kubeconfig] Writing "kubelet.conf" kubeconfig file [kubeconfig] Writing "controller-manager.conf" kubeconfig file [kubeconfig] Writing "scheduler.conf" kubeconfig file [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" [control-plane] Creating static Pod manifest for "kube-controller-manager" [control-plane] Creating static Pod manifest for "kube-scheduler" [etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests" [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 9.502219 seconds [upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace [kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster [upload-certs] Skipping phase. Please see --upload-certs [mark-control-plane] Marking the node k8s-master01 as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers] [mark-control-plane] Marking the node k8s-master01 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule node-role.kubernetes.io/control-plane:NoSchedule] [bootstrap-token] Using token: nsiavq.637f6t76cbtwckq9 [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 [kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key [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.1.31:6443 --token nsiavq.637f6t76cbtwckq9 \ --discovery-token-ca-cert-hash sha256:963b47c1d46199eb28c2813c893fcd201cfaa32cfdfd521f6bc78a70c13878c4 root@k8s-master01:~# root@k8s-master01:~# mkdir -p $HOME/.kube root@k8s-master01:~# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config root@k8s-master01:~# sudo chown $(id -u):$(id -g) $HOME/.kube/config root@k8s-master01:~# root@k8s-node01:~# kubeadm join 192.168.1.31:6443 --token nsiavq.637f6t76cbtwckq9 \ > --discovery-token-ca-cert-hash sha256:963b47c1d46199eb28c2813c893fcd201cfaa32cfdfd521f6bc78a70c13878c4 [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster. root@k8s-node01:~# root@k8s-node02:~# kubeadm join 192.168.1.31:6443 --token nsiavq.637f6t76cbtwckq9 \ > --discovery-token-ca-cert-hash sha256:963b47c1d46199eb28c2813c893fcd201cfaa32cfdfd521f6bc78a70c13878c4 [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster. root@k8s-node02:~# 验证root@k8s-master01:~# kubectl get node NAME STATUS ROLES AGE VERSION k8s-master01 Ready control-plane 86s v1.24.0 k8s-node01 Ready <none> 42s v1.24.0 k8s-node02 Ready <none> 37s v1.24.0 root@k8s-master01:~# root@k8s-master01:~# root@k8s-master01:~# kubectl get pod -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-bc77466fc-jxkpv 1/1 Running 0 83s kube-system coredns-bc77466fc-nrc9l 1/1 Running 0 83s kube-system etcd-k8s-master01 1/1 Running 0 87s kube-system kube-apiserver-k8s-master01 1/1 Running 0 89s kube-system kube-controller-manager-k8s-master01 1/1 Running 0 87s kube-system kube-proxy-2lgrn 1/1 Running 0 83s kube-system kube-proxy-69p9r 1/1 Running 0 47s kube-system kube-proxy-g58m2 1/1 Running 0 42s kube-system kube-scheduler-k8s-master01 1/1 Running 0 87s root@k8s-master01:~# https://www.oiox.cn/https://www.chenby.cn/https://blog.oiox.cn/https://cby-chen.github.io/https://blog.csdn.net/qq_33921750https://my.oschina.net/u/3981543https://www.zhihu.com/people/chen-bu-yun-2https://segmentfault.com/u/hppyvyv6/articleshttps://juejin.cn/user/3315782802482007https://cloud.tencent.com/developer/column/93230https://www.jianshu.com/u/0f894314ae2chttps://www.toutiao.com/c/user/token/MS4wLjABAAAAeqOrhjsoRZSj7iBJbjLJyMwYT5D0mLOgCoo4pEmpr4A/CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、个人博客、全网可搜《小陈运维》文章主要发布于微信公众号:《Linux运维交流社区》
2022年05月06日
532 阅读
3 评论
0 点赞
1
...
18
19
20
...
40