Kubernetes - alb/nlb

2024-04-26
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/ingress/annotations/
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/load-balancer-name: dev-nlb-2
    alb.ingress.kubernetes.io/ip-address-type: ipv4
    alb.ingress.kubernetes.io/backend-protocol-version: HTTP2
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-1:123828665029:certificate/13c70f1b-77c8-4de0-99ac-3644c8503503    alb.ingress.kubernetes.io/group.name: gc-grpc
    alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/ssl-redirect: "443"
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/security-groups: sg-0461323efd01ec, sg-02c5213211c2825761d
    alb.ingress.kubernetes.io/tags: env=dev,team=gpu-cloud
  labels:
    app: nexus-api-server
    app.kubernetes.io/instance: dev-nexus-api-server
    environment: dev
  name: dev-nlb-2
  namespace: gpu-cloud-dev
spec:
  ingressClassName: alb
  rules:
  - host: nexus.dev.infrai.com
    http:
      paths:
      - backend:
          service:
            name: nexus-api-server-http
            port:
              number: 8010
        path: /
        pathType: Prefix
https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/service/annotations/
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
    service.beta.kubernetes.io/aws-load-balancer-type: external
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-west-1:1231122335029:certificate/13c70f1b-77c8-ff22-2a2f-3644c8123503
    service.beta.kubernetes.io/aws-load-balancer-ssl-negotiation-policy: ELBSecurityPolicy-TLS13-1-2-2021-06
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
    service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: env=dev, team=test
  labels:
    app.kubernetes.io/instance: dev-nexus-api-server
  name: dev-nlb-15
  namespace: gpu-cloud-dev
spec:
  allocateLoadBalancerNodePorts: true
  externalTrafficPolicy: Cluster
  internalTrafficPolicy: Cluster
  ports:
  - port: 443
    protocol: TCP
    targetPort: 8011
  selector:
    app: nexus-api-server
  type: LoadBalancer