pengtao 92adf00e40 3
2022-05-04 14:47:05 +08:00
1
2022-04-25 14:18:37 +08:00
2022-03-23 22:18:18 +08:00
2022-03-28 17:13:04 +08:00
1
2022-04-13 09:35:07 +08:00
3
2022-05-04 14:47:05 +08:00
2022-03-23 22:18:18 +08:00
3
2022-05-04 14:47:05 +08:00
2022-03-23 22:18:18 +08:00
2022-03-23 22:27:21 +08:00
2022-03-23 22:18:18 +08:00
2022-03-23 22:18:18 +08:00
2022-03-23 22:18:18 +08:00
2022-03-23 22:18:18 +08:00
1
2022-04-13 09:35:07 +08:00
2022-04-11 22:59:04 +08:00

create namespace

kubectl apply -f namespace.yaml

查看 namespace

kubectl get namespace --show-labels kubectl config view | grep namespace:

切换默认namespace

kubectl config current-context kubectl config set-context test --namespace=app01
--cluster=docker-desktop
--user=docker-desktop

kubectl config set-context prod --namespace=production
--cluster=docker-desktop
--user=docker-desktop kubectl config set-context monitor --namespace=monitor --cluster=kubernetes-cluster --user=kubernetes-admin

kubectl config view

切换环境到DEV

kubectl config use-context test

check 当前环境

kubectl config current-context

查看配额

kubectl get resourcequotas kubectl get resourcequota app01-redis --output=yaml

create configmap

kubectl create configmap redis-conf --from-file=redis.conf

kubectl get configmap -n miles-app01

NAME DATA AGE kube-root-ca.crt 1 3m30s miles-app01-redis-conf 1 20s

创建和查看 pod

kubectl apply -f app01_redis.yaml kubectl get pods -n app01

注意configMap 会挂在 /usr/local/etc/redis/redis.conf 上。与 mountPath 和 configMap 下的 path 一同指定

kubectl get pod miles-app01-redis-b48ff8c66-q5cv2 -n miles-app01 kubectl run busybox --image=busybox --command -- ping baidu.com kubectl exec -it busybox -- /bin/bash k describe replicaset.apps/app01-redis-64847ffc48 k get all -ALL k describe pods

minikube 使用本地image 方法

eval $(minikube -p minikube docker-env) docker build -t .

Description
No description provided
Readme 64 KiB
Languages
Python 97.5%
Dockerfile 1.6%
Shell 0.9%