李明
|
通过pod创建service
cd deployk8s-master cd labs cd services
apiVersion: v1 kind: Pod metadata: name: nginx-pod labels: app: nginx spec: containers: - name: nginx-container image: nginx ports: - name: nginx-port containerPort: 8 kubectl create -f pod_nginx.yml kubectl get pods
kubectl expose pods nginx-pod -h expose pods nginx-pod --type=NodePort kubectl describe node
image.png
通过pod 根据yml文件的形式创建service
kubectl delete service nginx-pod kubectl get pods kubectl get svc get pods --show-labels more service_nginx.yml
image.png
kubectl create -f service_nginx.yml vim service_nginx.yml
|
2018-10-23 11:22:57