图解Kubernetes应用部署( 六 )

labels:

any-name: my-app

spec:

containers:

- name: cont1

image: learnk8s/app:1.0.0

ports:

- containerPort: 8080

---

apiVersion: v1

kind: Service

metadata:

name: my-service

spec:

ports:

- port: 80

targetPort: 8080

selector:

name: app

---

推荐阅读