K8s集群部署Tomcat服务问题整理和遇到的坑(已成功)
常用命令:kubectl get pods -o widekubectl get nodeskubectl get podsapiVersion: extensions/v1beta1kind: Deploymentmetadata:name: mywebspec:replicas: 2template:metadata:labels:...
·
常用命令:
kubectl get pods -o wide
kubectl get nodes
kubectl get pods
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: myweb
spec:
replicas: 2
template:
metadata:
labels:
app: myweb
spec:
containers:
- name: myweb
image: docker.io/tomcat
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: myweb
spec:
ports:
- port: 8099
targetPort: 8080
nodePort: 31111
selector:
app: myweb
type: NodePort
问题1 (加证书)
问题2(第一个创建资源对象一直为ContainerCreating大坑)
KUBELET_ARGS="–cluster-dns=192.168.20.22 --cluster-domain=playcrab-inc.com"
访问测试:http://192.168.20.88:31111/ 获取其他节点也可以
参考原文链接:
更多推荐
已为社区贡献1条内容
所有评论(0)