Update README.md
This commit is contained in:
parent
a856691295
commit
8cc2cda6a0
30
README.md
30
README.md
@ -67,13 +67,15 @@ spec:
|
|||||||
- --validating-webhook=:8443
|
- --validating-webhook=:8443
|
||||||
- --validating-webhook-certificate=/usr/local/certificates/cert
|
- --validating-webhook-certificate=/usr/local/certificates/cert
|
||||||
- --validating-webhook-key=/usr/local/certificates/key
|
- --validating-webhook-key=/usr/local/certificates/key
|
||||||
*** ADD >>> - --tcp-services-configmap=ingress-nginx/tcp-services <<< ADD ***
|
>>> ADD
|
||||||
*** ADD >>> - --udp-services-configmap=ingress-nginx/udp-services <<< ADD ***
|
- --tcp-services-configmap=ingress-nginx/tcp-services
|
||||||
|
- --udp-services-configmap=ingress-nginx/udp-services
|
||||||
|
<<< ADD
|
||||||
env:
|
env:
|
||||||
[...]
|
[...]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploy nginx-service and expose via nginx-ingress on TCP-port 9000
|
### Deploy my-nginx-service and expose via nginx-ingress on TCP-port 9000
|
||||||
my-nginx-deployment.yml:
|
my-nginx-deployment.yml:
|
||||||
```
|
```
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@ -129,7 +131,9 @@ Find the `ports:`-section of the `ingress-nginx-controller` service and *ADD* th
|
|||||||
[...]
|
[...]
|
||||||
spec:
|
spec:
|
||||||
clusterIP: 10.43.237.255
|
clusterIP: 10.43.237.255
|
||||||
externalTrafficPolicy: Cluster
|
>>> CHANGE externalTrafficPolicy from Cluster to Local if original client-IP is desirable
|
||||||
|
externalTrafficPolicy: Local
|
||||||
|
<<< CHANGE
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
nodePort: 30312
|
nodePort: 30312
|
||||||
@ -141,12 +145,12 @@ spec:
|
|||||||
port: 443
|
port: 443
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: https
|
targetPort: https
|
||||||
*** ADD >>>
|
>>> ADD
|
||||||
- name: proxied-tcp-9000
|
- name: proxied-tcp-9000
|
||||||
port: 9000
|
port: 9000
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: 9000
|
targetPort: 9000
|
||||||
<<< ADD ***
|
<<< ADD
|
||||||
[...]
|
[...]
|
||||||
```
|
```
|
||||||
Finally, we need to glue nginx-ingress with the my-nginx app. This will be done with the config-map `tcp-services-config-map.yml` referenced earlier in the nginx-ingress deployment definition:
|
Finally, we need to glue nginx-ingress with the my-nginx app. This will be done with the config-map `tcp-services-config-map.yml` referenced earlier in the nginx-ingress deployment definition:
|
||||||
@ -158,7 +162,7 @@ metadata:
|
|||||||
name: tcp-services
|
name: tcp-services
|
||||||
namespace: ingress-nginx
|
namespace: ingress-nginx
|
||||||
data:
|
data:
|
||||||
9000: "default/my-nginx:80::PROXY"
|
9000: "default/my-nginx:80"
|
||||||
```
|
```
|
||||||
Apply with `kubectl apply -f tcp-services-config-map.yml`:
|
Apply with `kubectl apply -f tcp-services-config-map.yml`:
|
||||||
```
|
```
|
||||||
@ -185,3 +189,15 @@ dominik@muggler:~$ curl -s http://10.62.94.246:9000
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
|
Check logs of my-nginx POD:
|
||||||
|
```
|
||||||
|
root@k3s-master:/k3s# kubectl get pods
|
||||||
|
NAME READY STATUS RESTARTS AGE
|
||||||
|
my-nginx-65c68bbcdf-xkhqj 1/1 Running 0 90m
|
||||||
|
```
|
||||||
|
```
|
||||||
|
kubectl logs my-nginx-65c68bbcdf-xkhqj -f
|
||||||
|
[...]
|
||||||
|
10.42.0.18 - - [23/Aug/2020:16:38:33 +0000] "PROXY TCP4 10.62.94.1 10.42.0.18 48558 9000" 400 157 "-" "-" "-"
|
||||||
|
[...]
|
||||||
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user