Advertisement
Guest User

manual-certificate

a guest
Oct 23rd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.40 KB | None | 0 0
  1. ---
  2. {{ if .Values.alias }}
  3. apiVersion: certmanager.k8s.io/v1alpha1
  4. kind: Certificate
  5. metadata:
  6.   name: alias-cert-{{ .Release.Namespace }}
  7. spec:
  8.   secretName: alias-lets-encrypt-tls
  9.   issuerRef:
  10.     name: {{ .Values.letsEncryptEnvironment }}
  11.     kind: ClusterIssuer
  12.   dnsNames:
  13.  {{- range .Values.alias }}
  14.   - {{ . }}
  15.   {{- end }}
  16.   acme:
  17.     config:
  18.     - http01:
  19.         ingressClass: nginx
  20.       domains:
  21.      {{- range .Values.alias }}
  22.       - {{ . }}
  23.       {{- end }}
  24.   issuerRef:
  25.     name: letsencrypt-staging
  26.     kind: ClusterIssuer
  27. {{- end }}
  28. ---
  29. # This apply the current context "." to $root
  30. # We need this to access the .Values in the range function
  31. # The range function sets the current context
  32. {{- $root := . -}}
  33. {{- range .Values.alias }}
  34. kind: Ingress
  35. apiVersion: extensions/v1beta1
  36. metadata:
  37.   name: alias-{{ . | lower | replace "." "-"}}
  38.   labels:
  39.     app: fpmpool
  40.     {{- include "standard_labels" $| indent 4 }}
  41.     {{- include "installation_info" $| indent 4 }}
  42.   annotations:
  43.     certmanager.k8s.io/cluster-issuer: letsencrypt-staging
  44. spec:
  45.   tls:
  46.     - secretName: alias-lets-encrypt-tls
  47.       hosts:
  48.        - {{ . }}
  49.   rules:
  50.     - host: {{ . }}
  51.       http:
  52.         paths:
  53.           - backend:
  54.               serviceName: {{ $root.Values.ingressBackendServiceName }}
  55.               servicePort: {{ $root.Values.ingressBackendServicePort }}
  56. ---
  57. {{- end }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement