kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch18/petshop/petshop-webservice.yml

50 lines
1.0 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: petshop-webservice
labels:
kiamol: ch18
spec:
ports:
- port: 80
targetPort: http
nodePort: 30003
selector:
app: petshop
component: webservice
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: petshop-webservice
labels:
kiamol: ch18
spec:
selector:
matchLabels:
app: petshop
component: webservice
template:
metadata:
labels:
app: petshop
component: webservice
spec:
containers:
- image: sixeyed/petshop-webservice:1809
name: petshop-webservice
ports:
- containerPort: 80
name: http
volumeMounts:
- name: connection-string
mountPath: "/petshop-webservice/config"
readOnly: true
volumes:
- name: connection-string
secret:
secretName: petshop-connection-string-secret
nodeSelector:
kubernetes.io/os: windows