k8sk8sk8s

kubeadm join 192.168.14.35:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:54ebcb5c7e7f92c0f146e3ba3345fdd1674b0113680d8cf7be6e4d2d53bc4e71 


按照官网的说法,将containerd的config.toml的sandbox_image从3.6改成3.2
--------------------------------
##1 get pods 报错:
E0320 08:24:46.710190    4791 memcache.go:265] couldn't get current server API group list: Get "https://192.168.126.35:6443/api?timeout=32s": tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

rm -rf .kube/
sudo mkdir ~/.kube
sudo cp /etc/kubernetes/admin.conf ~/.kube/
cd ~/.kube
sudo mv admin.conf config
sudo service kubelet restart
systemctl restart kubelet.service

kubeadm init --pod-network-cidr
--------------------------------
##2 添加阿里云源时,必须用ipv4不知道为什么
-------------------------------
##3 kubeadm reset后,要删除$HOME/.kube,否则再使用kubelet时会报错X509
------------------------------
##4 kubectl命令root不能用
-------------------------------
##5 cannot stat ‘/etc/kubernetes/admin.conf’: No such file or directory
从master节点复制到本节点
--------------------------------
##6 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.
这个节点和control-plane相排斥
--------------------------------
启动流程:
关闭防火墙、swap、
sudo swapoff -a
sudo ufw disable
sudo ufw status

root
rm -rf $HOME/.kube
kubeadm init --config=kubeadm.yaml
su me

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

kubectl apply -f kube-flannel.yml

kubectl get pods -n kube-system -o wide查看pod状态
kubectl get nodes查看节点
kubectl label no <hostname> kubernetes.io/role=<name>更改roles

-----------------------------------
promethus

kubectl create -f  node-exporter.yaml 
kubectl create -f  k8s-prometheus-grafana/prometheus/rbac-setup.yaml
kubectl create -f  k8s-prometheus-grafana/prometheus/configmap.yaml 
kubectl create -f  k8s-prometheus-grafana/prometheus/prometheus.deploy.yml 
kubectl create -f  k8s-prometheus-grafana/prometheus/prometheus.svc.yml 
-----------------------------------
grafana

kubectl create -f   k8s-prometheus-grafana/grafana/grafana-deploy.yaml
kubectl create -f   k8s-prometheus-grafana/grafana/grafana-svc.yaml
kubectl create -f   k8s-prometheus-grafana/grafana/grafana-ing.yaml
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值