90DaysOfDevOps/2022/tr/Days/Kubernetes/nginx-stateless-demo.yaml
2023-06-07 14:18:28 +03:00

41 lines
617 B
YAML

apiVersion: v1
kind: Namespace
metadata:
name: nginx
"labels": {
"name": "nginx"
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: nginx
spec:
selector:
app: nginx-deployment
ports:
- protocol: TCP
port: 80
targetPort: 80