1、创建appweb.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: appweb
spec:
replicas: 2
template:
metadata:
name: appweb
labels:
app: appweb
spec:
containers:
- name: appweb
image: tomcat
ports:
- containerPort: 80
创建该rc
kubectl create -f appweb.yaml
获取该pod的ip地址
[root@k8s-master service]# kubectl get po -l app=appweb -o yaml | grep -i ip
hostIP: 172.31.153.201
podIP: 172.17.0.6
hostIP: 172.31.153.200
创建个service提供服务
kubectl expose rc appweb
以上流程没跑通, 访问ip:port不行,不知道为什么,回头再来看看
网友评论