AWS ingress-nginx-controller TCP/UDP설정

문학적인유사성·2024년 4월 4일
0

뎁옵깃옵쿠베

목록 보기
46/53
post-custom-banner

exposing-tcp-udp-services

Configmap 만들기

apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: ingress-nginx
data:
  9000: "namespace/example-svc:8080"

Service에 신규 port추가

apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
    # aws용 annotation 넣는것 필수!
spec:
  type: LoadBalancer
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
    - name: https
      port: 443
      targetPort: 443
      protocol: TCP
    - name: proxied-tcp-9000 
      port: 9000 
      targetPort: 9000
      protocol: TCP
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

Deployment에 configmap 넣기

args:
    - /nginx-ingress-controller
    - --tcp-services-configmap=ingress-nginx/tcp-services
profile
Are you nervous? Don't be
post-custom-banner

0개의 댓글