mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2025-01-10 23:27:23 +07:00
41 lines
617 B
YAML
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
|