add low port / nodeport example
This commit is contained in:
parent
7366060170
commit
fa5e3c38ad
3 changed files with 111 additions and 2 deletions
41
generic/busybox-sleep-deployment-0-replicas.yaml
Normal file
41
generic/busybox-sleep-deployment-0-replicas.yaml
Normal file
|
@ -0,0 +1,41 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: busybox-sleep-0
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: busybox-sleep-0
|
||||
replicas: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: busybox-sleep-0
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox
|
||||
args:
|
||||
- sleep
|
||||
- "1000000"
|
||||
env:
|
||||
- name: MY_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: MY_POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: MY_POD_SERVICE_ACCOUNT
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.serviceAccountName
|
|
@ -38,7 +38,7 @@ metadata:
|
|||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: ge.nau.so
|
||||
- host: 2022-08-01.cdn.hjk.li
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
|
@ -48,7 +48,37 @@ spec:
|
|||
name: nginx-test-service
|
||||
port:
|
||||
number: 80
|
||||
- host: auch.ge.nau.so
|
||||
- host: 2022-08-01.cdnv4.hjk.li
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: nginx-test-service
|
||||
port:
|
||||
number: 80
|
||||
- host: 2022-08-01-2.cdn.hjk.li
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: nginx-test-service
|
||||
port:
|
||||
number: 80
|
||||
- host: 2022-08-01-2.cdnv4.hjk.li
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: nginx-test-service
|
||||
port:
|
||||
number: 80
|
||||
- host: 2022-08-02.cdnv4.hjk.li
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
|
|
38
generic/nodeport-nginx-service.yaml
Normal file
38
generic/nodeport-nginx-service.yaml
Normal file
|
@ -0,0 +1,38 @@
|
|||
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
|
Loading…
Reference in a new issue