cosmetic changes

This commit is contained in:
Dominik Chilla 2020-08-26 18:31:51 +02:00
parent b2086997a5
commit 40b6ec78d1

View File

@ -118,7 +118,7 @@ spec:
<<< ADD <<< ADD
[...] [...]
``` ```
Verify nginx-ingress is listening on port 9000 with `kubectl get all --all-namespaces`: Verify nginx-ingress-controller is a Loadbalancer and listening on port 9000 with `kubectl get services -n ingress-nginx`:
``` ```
[...] [...]
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
@ -127,7 +127,7 @@ ingress-nginx service/ingress-nginx-controller LoadBalancer 10.4
[...] [...]
``` ```
### Deploy my-nginx-service <a name="deploy-my-nginx-service"></a> ### Deploy my-nginx deployment and service <a name="deploy-my-nginx-service"></a>
my-nginx-deployment.yml: my-nginx-deployment.yml:
``` ```
apiVersion: apps/v1 apiVersion: apps/v1
@ -168,17 +168,16 @@ Apply with `kubectl apply -f my-nginx-deployment.yml`:
deployment.apps/my-nginx created deployment.apps/my-nginx created
service/my-nginx created service/my-nginx created
``` ```
Test: `kubectl get all`: Test: `kubectl get all | grep my-nginx`:
``` ```
[...] pod/my-nginx-65c68bbcdf-xkhqj 1/1 Running 4 2d7h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/my-nginx ClusterIP 10.43.118.13 <none> 80/TCP 2d7h
[...] deployment.apps/my-nginx 1/1 1 1 2d7h
service/my-nginx ClusterIP 10.43.118.13 <none> 80/TCP 99s replicaset.apps/my-nginx-65c68bbcdf 1 1 1 2d7h
[...]
``` ```
## Stick the nginx-ingress controler and my-nginx app together <a name="stick-nginx-ingress-and-tcp-service"></a> ## Stick the nginx-ingress-controler and my-nginx app together <a name="stick-nginx-ingress-and-tcp-service"></a>
Finally, the nginx-ingress controller needs a port-mapping pointing to 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, the nginx-ingress controller needs a port-mapping pointing to the my-nginx app. This will be done with a config-map `nginx-ingress-tcp-services-config-map.yml`, referenced earlier in the nginx-ingress deployment definition:
``` ```
--- ---
apiVersion: v1 apiVersion: v1
@ -189,11 +188,11 @@ metadata:
data: data:
"9000": default/my-nginx:80 "9000": default/my-nginx:80
``` ```
Apply with `kubectl apply -f tcp-services-config-map.yml`: Apply with `kubectl apply -f nginx-ingress-tcp-services-config-map.yml`:
``` ```
configmap/tcp-services created configmap/tcp-services created
``` ```
Subsequently the config-map can be edited with `kubectl edit configmap tcp-services -n ingress-nginx` Subsequently the config-map can be edited with `kubectl -n ingress-nginx edit configmap tcp-services`
**Changes to config-maps do not take effect on running pods! A re-scale to 0 and back can solve this problem: https://stackoverflow.com/questions/37317003/restart-pods-when-configmap-updates-in-kubernetes** **Changes to config-maps do not take effect on running pods! A re-scale to 0 and back can solve this problem: https://stackoverflow.com/questions/37317003/restart-pods-when-configmap-updates-in-kubernetes**
@ -255,7 +254,11 @@ kubectl logs my-nginx-65c68bbcdf-xkhqj -f
# Running DaemonSets on `hostPort` <a name="running-daemonsets"></a> # Running DaemonSets on `hostPort` <a name="running-daemonsets"></a>
Docs: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ Docs: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
In this case configuration of networking in context of services are not needed. In this case configuration of networking in context of services is not needed.
This setup is suitable for legacy scenarios where static IP-address are required:
* inbound mailserver
* dns server
``` ```
kind: DaemonSet kind: DaemonSet
@ -272,7 +275,7 @@ spec:
metadata: metadata:
labels: labels:
app: netcat-daemonset app: netcat-daemonset
spec: spec:
containers: containers:
- command: - command:
- nc - nc