apiVersion: apps/v1
kind: Deployment
metadata:
name: ygw-deployment
spec:
replicas: 3
selector:
matchLabels:
app: ygw-app
template:
metadata:
labels:
app: ygw-app
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
env:
- name: INITIALS
value: YGW
YAML
복사
apiVersion: v1
kind: Service
metadata:
name: ygw-service
spec:
selector:
app: ygw-app
ports:
- protocol: TCP
port: 80
targetPort: 80
YAML
복사
apiVersion: apps/v1
kind: Deployment
metadata:
name: ygw-deployment
spec:
replicas: 3
selector:
matchLabels:
app: ygw-app
template:
metadata:
labels:
app: ygw-app
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
env:
- name: INITIALS
value: YGW
command: ["sh", "-c"]
args: ["echo 'HELLO KEA-$INITIALS' > /usr/share/nginx/html/index.html && exec nginx -g 'daemon off;'"]
YAML
복사