安全版的kubernetes集群我们部署完成了。
下面我们使用新集群先温习一下之前学习过的命令,然后再认识一些新的命令,新的参数,新的功能。

熟悉命令

kubectl get svc
kubectl run kubernetes-bootcamp --image=jocatalin/kubernetes-bootcamp:v1 --port=8080
kubectl get pods
kubectl get deploy
kubectl logs kubernetes-bootcamp-6b7849c495-bqc5r -f

kubectl describe pods
kubectl exec -it kubernetes-bootcamp-6b7849c495-bqc5r bash


kubectl get serviceaccount -o json
kubectl get secrets -o yaml
nginx-pod.yaml 文件
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
kubectl apply -f nginx-pod.yaml
kubectl get pod
kubectl describe pods nginx
这个比create生成时候多了Anntations。create是删除,在创建。apply是原有的应用的基础上覆盖,可以回滚。



kubectl run busybox --rm=true --image=busybox --restart=Never --tty -i

PS:基本就是测试下安全认证的k8s是否可以正常的使用,也使用了几个命令,其实我感觉,kubernetes 跟docker的命令很类似,环境搭建是大头,环境能搭建下,后面的顺水推舟就可以了 。
|