k8s-clusters/cluster/home/default/my-nginx.yml
2022-02-08 16:06:04 -06:00

38 lines
597 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
namespace: default
spec:
selector:
matchLabels:
run: my-nginx
replicas: 2
template:
metadata:
labels:
run: my-nginx
spec:
containers:
- name: my-nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: my-nginx
labels:
run: my-nginx
namespace: default
spec:
allocateLoadBalancerNodePorts: false
type: LoadBalancer
ports:
- port: 8000
targetPort: 80
protocol: TCP
selector:
run: my-nginx