ungleich-k8s/generic/nodeport-nginx-service.yaml
2022-08-21 22:19:19 +02:00

38 lines
793 B
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-nodeport
spec:
selector:
matchLabels:
app: nginx-nodeport
replicas: 2
template:
metadata:
labels:
app: nginx-nodeport
spec:
containers:
- name: nginx
image: nginx:1.20.0-alpine
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service-nodeport
spec:
type: NodePort
selector:
app: nginx-nodeport
ports:
- protocol: TCP
port: 80
nodePort: 179
# The Service "nginx-service-nodeport" is invalid:
# spec.ports[0].nodePort:
# Invalid value: 1179: provided port is not in the valid range. The range of valid ports is 30000-32767
# kube api server: - --service-node-port-range=20000-22767