概述
部署Rancher,建议单独部署在一台机器上,和集群分离
前面端口是宿主机端口 后面端口是容器端口
docker run -d --restart=unless-stopped
-p 80:80 -p 443:443
-v /data/rancher:/var/lib/rancher
rancher/rancher:latest
创建集群,编辑集群配置文件,设置资源预留和限制
kubelet:
extra_args:
enforce-node-allocatable: pods
kube-reserved: memory=2Gi
system-reserved: memory=300Mi
预先按照open-iscsi
yum install iscsi-initiator-utils
在系统设置里把xip.io(用的人太多,不稳定) 替换成 nip.io
配置kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
从Rancher的Cluster界面下载KubeConfigFile
mkdir ~/.kube
vim ~/.kube/config
kubectl cluster-info
常用kubectl命令
清除kafka service
helm del --purge kafka
查看服务状态
kubectl get pod -n kafka -o wide
查看单独pod
kubectl describe pod -n kafka kafka-0
部署helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod 755 get_helm.sh
./get_helm.sh
helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.0
helm list
#如果报错,修复
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
helm init --service-account tiller --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.0
# 添加国内源
helm repo add stable https://burdenbear.github.io/kube-charts-mirror/
helm repo update
helm直接部署服务
helm install --name kong --set admin.useTLS=false,admin.servicePort=8001,admin.containerPort=8001,proxy.useTLS=false,proxy.servicePort=8000,proxy.containerPort=8000,livenessProbe.httpGet.scheme=HTTP,readinessProbe.httpGet.scheme=HTTP stable/kong
彻底删除Rancher
docker rm -f $(sudo docker ps -aq);
docker volume rm $(sudo docker volume ls -q);
rm -rf /etc/ceph
/etc/cni
/etc/kubernetes
/opt/cni
/opt/rke
/run/secrets/kubernetes.io
/run/calico
/run/flannel
/var/lib/calico
/var/lib/etcd
/var/lib/cni
/var/lib/kubelet
/var/lib/rancher/rke/log
/var/log/containers
/var/log/pods
/var/run/calico
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -f /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db
sudo systemctl restart containerd
sudo systemctl restart docker
IPTABLES="/sbin/iptables"
cat /proc/net/ip_tables_names | while read table; do
$IPTABLES -t $table -L -n | while read c chain rest; do
if test "X$c" = "XChain" ; then
$IPTABLES -t $table -F $chain
fi
done
$IPTABLES -t $table -X
done
rm -rf /data/docker_data/rancher/
systemctl restart docker
iptables 丢失修复
https://my.oschina.net/u/3438714/blog/1204096
最后
以上就是温婉翅膀为你收集整理的Rancher部署日志的全部内容,希望文章能够帮你解决Rancher部署日志所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复