Skip to content

Commit

Permalink
feat: add support for custom certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Aug 15, 2022
1 parent 5093cbd commit 809ae3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions drydock/templates/kustomized/tutor13/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ DRYDOCK_LMS_WORKER_REQUEST_CPU: "600m"
DRYDOCK_LMS_WORKER_REQUEST_MEMORY: "1Gi"
DRYDOCK_NEWRELIC: False
DRYDOCK_NEWRELIC_CONFIG: ""
DRYDOCK_CUSTOM_CERTS: {}
19 changes: 18 additions & 1 deletion drydock/templates/kustomized/tutor13/extensions/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ K8S_NAMESPACE }}
annotations:
kubernetes.io/ingress.class: nginx
{%- if ENABLE_HTTPS %}
{%- if ENABLE_HTTPS and not DRYDOCK_CUSTOM_CERTS%}
cert-manager.io/issuer: letsencrypt
{%- endif %}
spec:
Expand Down Expand Up @@ -43,9 +43,25 @@ spec:
{%- for host in DRYDOCK_INGRESS_EXTRA_HOSTS %}
- {{ host }}
{%- endfor %}
{% if DRYDOCK_CUSTOM_CERTS -%}
secretName: {{ DRYDOCK_CUSTOM_CERTS["secret_name"]|default("custom-tls-certs") }}
{% else -%}
secretName: {{ K8S_NAMESPACE }}-tls
{%- endif %}
{%- endif %}
{% if ENABLE_HTTPS -%}
{% if DRYDOCK_CUSTOM_CERTS -%}
---
apiVersion: v1
kind: Secret
type: kubernetes.io/tls
metadata:
name: {{ DRYDOCK_CUSTOM_CERTS["secret_name"]|default("custom-tls-certs") }}
namespace: {{ K8S_NAMESPACE }}
data:
tls.crt: {{ DRYDOCK_CUSTOM_CERTS["crt"] }}
tls.key: {{ DRYDOCK_CUSTOM_CERTS["key"] }}
{% else %}
---
apiVersion: cert-manager.io/v1
kind: Issuer
Expand All @@ -68,3 +84,4 @@ spec:
ingress:
class: nginx
{% endif -%}
{% endif -%}

0 comments on commit 809ae3e

Please sign in to comment.