kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch07/sleep/sleep-with-server.yaml

25 lines
581 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: sleep
labels:
kiamol: ch07
spec:
selector:
matchLabels:
app: sleep
template:
metadata:
labels:
app: sleep
spec:
containers:
- name: sleep
image: kiamol/ch03-sleep
- name: server
image: kiamol/ch03-sleep
command: ['sh', '-c', "while true; do echo -e 'HTTP/1.1 200 OK\nContent-Type: text/plain\nContent-Length: 7\n\nkiamol' | nc -l -p 8080; done"]
ports:
- containerPort: 8080
name: http