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

27 lines
639 B
YAML
Raw Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: sleep
labels:
kiamol: ch07
spec:
selector:
matchLabels:
app: sleep
template:
metadata:
labels:
app: sleep
version: shared
spec:
shareProcessNamespace: true
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