k8s官方案例练习-使用 Redis 部署 PHP 留言板应用程序

2021-04-25 12:27

阅读:356

[root@master01 guestbook]# cat frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# comment or delete the following line if you want to use a LoadBalancer
type: NodePort
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
# type: LoadBalancer
ports:
- port: 80
selector:
app: guestbook
tier: frontend


[root@master01 guestbook]# vi frontend-service.yaml [root@master01 guestbook]# vi frontend-service.yaml [root@master01 guestbook]# kubectl apply -f frontend-service.yaml service/frontend created [root@master01 guestbook]# kubectl get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE frontend NodePort 10.111.192.148 80:30351/TCP 6s kuard ClusterIP 10.110.133.234 80/TCP 2d2h kubernetes ClusterIP 10.96.0.1 443/TCP 2d2h redis-master ClusterIP 10.102.97.125 6379/TCP 56m redis-slave ClusterIP 10.110.55.92 6379/TCP 34m


评论


亲,登录后才可以留言!