Exposing TCP

are not told how to connect file configmap ? (https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/exposing-tcp-udp-services.md)

Аnd in what file and how?

Sample configuration

Creation of nginx-tcp-server-conf configmap

#cat nginx-tcp-server-conf.yaml

apiVersion: v1

kind: ConfigMap

metadata:

name: nginx-tcp-server-conf

data:

22: "test/sftp-server:22"

#kubectl create -f nginx-tcp-server-conf.yaml

Creation of nginx-udp-server-conf configmap

#cat nginx-udp-server-conf.yaml

apiVersion: v1

kind: ConfigMap

metadata:

name: nginx-udp-server-conf

data:

161: "test/snmp:161"

#kubectl create -f nginx-tcp-server-conf.yaml

Update –udp-services-configmap & --tcp-services-configmap arguments in nginx-ingress-controller-controller deployment

#kubectl edit deployment nginx-ingress-controller-controller

spec:

containers:

  • args:

  • /nginx-ingress-controller

  • –default-backend-service=default/nginx-ingress-controller-default-backend

  • –election-id=ingress-controller-leader

  • –ingress-class=nginx

  • –configmap=default/nginx-ingress-controller-controller

- --tcp-services-configmap=default/nginx-tcp-server-conf

- --udp-services-configmap= default /nginx-udp-server-conf

Check out my manifests at https://github.com/mateothegreat/k8-byexamples-ingress-controller/tree/master/manifests … this should get you up and running real quick!

1 Like