docker run -d --name registry -p 5000:5000 --restart=always -v /opt/registry/:/var/lib/registry/ registry
===============================================================================================================
CHANGE MASTER TO \
MASTER_HOST='10.10.10.36', \
MASTER_USER='jxslave', \
MASTER_PASSWORD='123456', \
MASTER_PORT=3306, \
MASTER_AUTO_POSITION=1;
===============================================================================================================
# 基于alpine镜像来做
FROM alpine
# 替换软件源地址为清华软件源
RUN sed -i 's/https:\/\/dl-cdn.alpinelinux.org/http:\/\/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
# 更新软件源,安装JDK等运行环境
RUN apk update && apk add redis
# 告诉镜像,开机执行/init.sh
ENTRYPOINT ["redis-server", "--protected-mode", "no", "--cluster-enabled", "yes", "--dir", "/var/lib/redis/"]
===============================================================================================================
redis-cli --cluster create --cluster-replicas 1 jxredis-0.jxredis:6379 jxredis-1.jxredis:6379 jxredis-2.jxredis:6379 jxredis-3.jxredis:6379 jxredis-4.jxredis:6379 jxredis-5.jxredis:6379
===============================================================================================================
maven替换国内源
nexus-aliyun
central
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public
===============================================================================================================
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
reboot
yum -y install wget
wget http://stu.jxit.net.cn:88/k8s/kubeasz-3.6.1.tar.gz
tar -zxf kubeasz-3.6.1.tar.gz
cd kubeasz-3.6.1/
bash -x ./ezdown -D
cd /etc/kubeasz/
yum -y install epel*
yum -y install ansible python3
./ezctl new k8s27
./ezctl setup k8s27 01 -vv
vim clusters/k8s27/hosts
./ezctl setup k8s27 01 -vv
./ezctl setup k8s27 02 -vv
./ezctl setup k8s27 03 -vv
./ezctl setup k8s27 04 -vv
./ezctl setup k8s27 05 -vv
./ezctl setup k8s27 06 -vv
./ezctl setup k8s27 07 -vv
kubectl get pod -n kube-system
ssh-keygen
ssh-copy-id root@10.10.10.11
ssh-copy-id root@10.10.10.12
ssh-copy-id root@10.10.10.13
mkdir -p /etc/kubernetes/ssl
yum -y install ipvsadm ipset
yum -y install epel*
kubectl create deployment nginx --image=evild/alpine-nginx
kubectl expose deployment nginx --port=80 --type=NodePort
kubectl create deployment apache --image=evild/alpine-nginx
kubectl expose deployment apache --port=80 --type=NodePort
kubectl get pod -n kube-system
kubectl get pod
kubectl get pod,svc
whereis kubectl
ls /opt/kube/bin/
crictl
kubectl get pod,svc
kubectl exec -it pod/apache-77d8898946-lp2rr
kubectl exec -it pod/apache-77d8898946-lp2rr sh
ls
kubectl get pod,svc
kubectl get pod,svc -o wide
ip a
ipvsadm -Ln
ip a
kubectl get pod,svc -o wide
iptables-save
kubectl get pod,svc -o wide
ipvsadm -Ln
kubectl get pod,svc -o wide
lsmod
lsmod | grep ip_vs
ip a
ping qq.com
ip r
killall openvpn
ls
rm * -rf
ls
wget http://121.56.118.232:88/k8s/helm-v3.10.0-linux-amd64.tar.gz
yum -y install wget
wget http://121.56.118.232:88/k8s/helm-v3.10.0-linux-amd64.tar.gz
wget http://dl.jxit.net.cn/k8s/helm-v3.10.0-linux-amd64.tar.gz
ls
tar -zxf helm-v3.10.0-linux-amd64.tar.gz
ls
cd linux-amd64/
ls
mv helm /usr/local/bin/
ls
helm --help
cd
ls
rm * -rf
ls
helm repo
helm repo list
vim .kube/config
helm repo add aliyuncs https://apphub.aliyuncs.com
ping apphub.aliyuncs.com
helm repo add aliyuncs https://apphub.aliyuncs.com
curl https://apphub.aliyuncs.com/index.yaml
helm search hub promtail
helm repo add loki https://grafana.github.io/loki/charts
helm repo add deepflow https://deepflowio.github.io/deepflow
helm repo update deepflow
cat << EOF > values-custom.yaml
global:
allInOneLocalStorage: true
EOF
ls
elm install deepflow -n deepflow deepflow/deepflow --create-namespace \
helm install deepflow -n deepflow deepflow/deepflow --create-namespace -f values-custom.yaml
helm repo delete deepflow
helm repo remove deepflow
helm repo add deepflow https://deepflow-ce.oss-cn-beijing.aliyuncs.com/chart/stable
helm repo update deepflow
cat << EOF > values-custom.yaml
global:
allInOneLocalStorage: true
image:
repository: registry.cn-beijing.aliyuncs.com/deepflow-ce
grafana:
image:
repository: registry.cn-beijing.aliyuncs.com/deepflow-ce/grafana
EOF
ls
helm install deepflow -n deepflow deepflow/deepflow --create-namespace -f values-custom.yaml
curl -o /usr/bin/deepflow-ctl https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/ctl/stable/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-ctl
chmod a+x /usr/bin/deepflow-ctl
NODE_PORT=$(kubectl get --namespace deepflow -o jsonpath="{.spec.ports[0].nodePort}" services deepflow-grafana)
NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
echo -e "Grafana URL: http://$NODE_IP:$NODE_PORT \nGrafana auth: admin:deepflow"
netstat -anp | grep 30525
netstat -anp | grep proxy
kubectl get pod -n deepflow
kubectl describe pod/deepflow-clickhouse-0 -n deepflow
kubectl get pod,svc -n deepflow
kubectl get pod -o wide -n deepflow
kubectl describe pod/deepflow-clickhouse-0 -n deepflow
kubectl get pod -o wide -n deepflow
kubectl describe pod/deepflow-grafana-584df47c9f-zd589 -n deepflow
kubectl get pod -o wide -n deepflow
kubectl logs pod/deepflow-server-6f58865f49-nvt96 -n deepflow
kubectl get pod -o wide -n deepflow
kubectl logs pod/deepflow-server-6f58865f49-nvt96 -n deepflow
kubectl get pod -o wide -n deepflow
kubectl logs pod/deepflow-server-6f58865f49-nvt96 -n deepflow
kubectl get pod -o wide -n deepflow
helm release list
helm
helm list
helm list --all
helm list
helm list --help
helm list -A
helm
helm list -A
helm uninstall deeplown
helm uninstall deepflow
helm uninstall deepflow -n deepflow
kubectl get pod -o wide -n deepflow
ls /opt/kube/bin/
find / -name ctr
echo $PATH
/opt/kube/bin/ctr image
/opt/kube/bin/ctr image ls
helm install deepflow -n deepflow deepflow/deepflow --create-namespace -f values-custom.yaml
helm list -n deepflow
kubectl get pod -o wide -n deepflow
kubectl logs pod/deepflow-server-6f58865f49-z6fvr -n deepflow
kubectl get pod -o wide -n deepflow
kubectl logs pod/deepflow-mysql-94f899b7d-v6bhd -n deepflow
kubectl get pod -o wide -n deepflow
netstat -anp | grep proxy
helm uninstall deepflow -n deepflow
helm upgrade --install loki grafana/loki-stack --set grafana.enabled=true -n logging
helm repo add loki https://grafana.github.io/loki/charts
helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm search stable loki
helm search repo stable loki
helm search repo stable
helm search repo loki
helm repo list
helm repo search stable
helm repo search stable loki
helm search
helm search stable
helm search stable loki
helm search repo
helm search stable loki loki
helm search stable loki
helm search stable
helm search repo
helm search repo stable
helm search repo stable | grep loki
helm repo add loki https://grafana.git
helm search hub loki
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm upgrade --install loki --namespace=loki-stack grafana/loki-stack
yum -y install openvpn
wget http://stu.jxit.net.cn:88/jxfiles/jxvpn-xjp.ovpn
ls
openvpn --config jxvpn-xjp.ovpn
ssh root@10.10.10.254
ls
ip a
helm upgrade --install loki --namespace=loki-stack grafana/loki-stack
helm upgrade --install loki grafana/loki-stack
helm list
kubectl get pod,svc
helm uninstall loki
helm upgrade --install loki grafana/loki-stack --set grafana.enabled=true
kubectl get pod,svc
kubectl port-forward --namespace service/loki-grafana 3000:80
kubectl port-forward service/loki-grafana 3000:80
kubectl l get pod,svc
kubectl get pod,svc
kubectl port-forward service/loki-grafana 0.0.0.03000:80
kubectl port-forward service/loki-grafana 0.0.0.0:3000:80
kubectl port-forward service/loki-grafana 3000:80
df
kubectl get pod,svc
kubectl edit service/loki-grafana
kubectl get pod,svc
curl 10.10.10.11:8103
kubectl get secret --namespace loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
kubectl get secret loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
helm repo add dasmeta https://dasmeta.github.io/helm/
helm install my-weave-scope dasmeta/weave-scope --version 1.0.2
helm repo add cloudnativeapp https://cloudnativeapp.github.io/charts/curated/
helm install my-weave-scope cloudnativeapp/weave-scope --version 1.0.0
kubectl create ns helm install my-weave-scope cloudnativeapp/weave-scope --version 1.0.0
kubectl create ns weave-scope-agent-my-weave-scope
helm install my-weave-scope cloudnativeapp/weave-scope --version 1.0.0
kubectl create ns my-weave-scope
helm install my-weave-scope cloudnativeapp/weave-scope --namespace my-weave-scope --version 1.0.0
helm list -A
helm repo add dasmeta https://dasmeta.github.io/helm/
helm install my-weave-scope dasmeta/weave-scope --version 1.0.2
helm repo add stable http://mirror.azure.cn/kubernets/charts
helm repo add azure http://mirror.azure.cn/kubernets/charts
helm repo add azure http://mirror.azure.cn/kubernetes/charts
helm repo azure update
helm install k8s-topo azure/weave-scope
helm pull azure/weave-scope
ls
tar -zxf weave-scope-1.1.12.tgz
ls
cd weave-scope
ls
grep rbac -rn .
vim charts/weave-scope-cluster-agent/templates/clusterrole.yaml
vim charts/weave-scope-cluster-agent/templates/clusterrolebinding.yaml
grep rbac -rn .
helm install k8s-topo .
kubectl get pod,svc
kubectl edit svc/k8s-topo-weave-scope
kubectl get pod,svc
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts 作者:bili_39183997178 https://www.bilibili.com/read/cv21951318/ 出处:bilibili
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm search repo prometheus-operator
helm install azure/prometheus-operator
helm install prometheus-k8s azure/prometheus-operator
helm pull azure/prometheus-operator
ls
mv prometheus-operator-9.3.2.tgz /root/
ls
cd
ls
tar -zxf prometheus-operator-9.3.2.tgz
ls
cd prometheus-operator
ls
grep beta -rn .
helm install prometheus-k8s .
vim crds/crd-alertmanager.yaml
helm install prometheus-k8s .
vim crds/crd-alertmanager.yaml
ls
cd ..
ls
rm prometheus-operator-9.3.2.tgz -rf
cd prometheus-operator/
vim crds/crd-alertmanager.yaml
helm install prometheus-k8s .
vim crds/crd-alertmanager.yaml
helm install prometheus-k8s .
cd
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --version 9.4.10
helm search repo prometheus-stack
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 48.1.2
vim a.py
python a.py
vim a.py
python a.py
vim a.py
python a.py
vim /etc/hosts
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 48.1.2
ping github.com
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 48.1.2
vim /etc/hosts
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 48.1.2
helm list
helm list -A
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 48.1.2
yum -y install lrzs
yum -y install lrzsz
rz -E
ls
tar -zxf kube-prometheus-stack-48.1.2.tgz
ls
cd kube-prometheus-stack
ls
helm install prometheus .
helm install prometheus-stack .
kubectl get pod
helm install prometheus-stack .
netstat -anp | grep 6443
ipvsadm -Ln
ipvsadm -Ln | grep 3000
ssh root@10.10.10.254
ls
cd /boot/grub2
ls
vim grub.cfg
ls
cd . .
ls
cd ..
ls
pwd
kubectl get pod,svc
kubectl get pod,svc -o wide
cd /etc/kubeasz/
ls
./ezctl --help
./ezctl del-node k8s27 10.10.10.11
kubectl get pod
kubectl get pod -o wide
vim /etc/profile
source /etc/profile
kubectl get pod -o wide
crictl ps
crictl ps -a
df
tail -f /var/log/messages
ls
./ezctl del-node k8s27 10.10.10.11
./ezctl del-node k8s27 10.10.10.11 -vv
./ezctl del-node k8s27 10.10.10.11 -dd
./ezctl del-node k8s27 10.10.10.11
poweroff
wget https://charts.kubesphere.io/main/ks-core-0.4.0.tgz
kubectl get pod -o wide
kubectl get all
yum install rpcbind nfs-utils -y
mkdir /nfs_data
chmod +w /nfs_data
chmod +x /nfs_data
vim /etc/exports
service nfs start
service rpcbind start
yum -y install wget
wget http://stu.jxit.net.cn:88/k8s/charts-master.zip
ls
mv charts-master.zip /mnt/
ls
cd /mnt/
ls
yum -y install unzip
ls
unzip charts-master.zip
ls
cd charts-master
ls
cd stable/
ls
cd nfs-client-provisioner/
ls
helm install . --set nfs.server=10.10.10.11 --set nfs.path=/nfs_data --set storageClass.defaultClass=true --name mynfs-client
helm install . --set nfs.server=10.10.10.11 --set nfs.path=/nfs_data --set storageClass.defaultClass=true mynfs-client
helm install mynfs-client . --set nfs.server=10.10.10.11 --set nfs.path=/nfs_data --set storageClass.defaultClass=true
yum install -y bash-completion
source /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
s
ls
cd
ls
kubectl get sc
kubectl get sc,pv,pvc
kubectl get pod
helm upgrade --install -n kubesphere-system --create-namespace ks-core https://charts.kubesphere.io/main/ks-core-0.4.0.tgz --set apiserver.nodePort=30881 --debug --wait
ls
cd /mnt/
ls
wget http://stu.jxit.net.cn:88/k8s/ks-core-0.4.0.tgz
ls
tar -zxf ks-core-0.4.0.tgz
ls
cd ks-core/
ls
helm upgrade --install -n kubesphere-system --create-namespace ks-core http://stu.jxit.net.cn:88/k8s/ks-core-0.4.0.tgz --set apiserver.nodePort=30881 --debug --wait
kubectl get pod -n kubesphere-system
kubectl get ns
kubectl get all -n kubesphere-system
kubectl get node
poweroff
history
history > cmd-k8s27.txt