Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

1.5 KB
Raw Blame
{{- if .Values.ingress.enabled }}
{{- $svcKey := .Values.ingress.service }}
{{- $svc := index .Values.services $svcKey }}
{{- if or (not $svc) (not (has $svcKey (list "portal" "core" "web-ui"))) }}
{{- fail "ingress.service must name an enabled HTTP service: portal, core, or web-ui (auth and admin are embedded)" }}
{{- end }}
{{- if not $svc.enabled }}
{{- fail (printf "ingress.service %s is disabled" $svcKey) }}
{{- end }}
{{- $svcName := printf "%s-%s" (include "qm.fullname" .) $svcKey }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ include "qm.fullname" . }}
  labels:
    {{- include "qm.labels" . | nindent 4 }}
  annotations:
    {{- if and .Values.ingress.tls .Values.ingress.clusterIssuer }}
    cert-manager.io/cluster-issuer: {{ .Values.ingress.clusterIssuer | quote }}
    {{- end }}
    {{- with .Values.ingress.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
spec:
  {{- with .Values.ingress.className }}
  ingressClassName: {{ . }}
  {{- end }}
  {{- if .Values.ingress.tls }}
  tls:
    - hosts:
        {{- range .Values.ingress.hosts }}
        - {{ . | quote }}
        {{- end }}
      secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "qm.fullname" .)) }}
  {{- end }}
  rules:
    {{- range .Values.ingress.hosts }}
    - host: {{ . | quote }}
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: {{ $svcName }}
                port:
                  number: {{ $svc.port }}
    {{- end }}
{{- end }}