ThinkDeepTech/thinkdeep

View on GitHub
packages/deep-microservice-gateway/templates/service.yml

Summary

Maintainability
Test Coverage
apiVersion: v1
kind: Service
metadata:
  name: {{ printf "%s-deep-microservice-gateway-service" .Release.Name | quote }}
  namespace: {{ .Release.Namespace | quote }}
  annotations:
    # No TLS port annotation needed since 443 is assumed for HTTPS when another TLS option annotation is given.
    # service.beta.kubernetes.io/do-loadbalancer-certificate-id: "12cba529-a0a4-4c85-a928-0d9154040f91"
    {{ if .Values.service.certificateId }}
    service.beta.kubernetes.io/do-loadbalancer-certificate-id: {{ .Values.service.certificateId | quote }}
    service.beta.kubernetes.io/do-loadbalancer-protocol: "http2"
    service.beta.kubernetes.io/do-loadbalancer-algorithm: "round_robin"
    service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
    {{ end }}
spec:
  type: LoadBalancer
  selector:
    app: {{ printf "%s-deep-microservice-gateway-deployment" .Release.Name | quote }}
  ports:
    - name: http
      protocol: TCP
      port: {{ .Values.graphql.port }}
    {{ if .Values.service.certificateId }}
    - name: https
      protocol: TCP
      port: 443
      targetPort: {{ .Values.graphql.port }}
    {{ end }}