Skip to content

Commit

Permalink
Merge pull request #8 from projectsyn/tls-ingress
Browse files Browse the repository at this point in the history
Add TLS spec to Ingress
  • Loading branch information
ccremer authored Jan 20, 2022
2 parents 7fabc3d + 453a73c commit 9682217
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ parameters:
ingress:
host: null
labels: {}
annotations: {}
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production

ocp_route:
host: null
Expand Down
8 changes: 8 additions & 0 deletions component/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,14 @@ local cluster = function(name, options)
},
},
],
tls: [
{
hosts: [
options.ingress.host,
],
secretName: name + '-tls',
},
],
},
};

Expand Down
5 changes: 4 additions & 1 deletion docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,16 @@ type:: string
default:: `null`

If set, an ingress with the defined host is created.
The ingress is created with TLS spec for the same host.

NOTE: It's assumed that `cert-manager` is running on the cluster to provision Let's Encrypt certificates.


== `ingress.annotations`

[horizontal]
type:: dict
default:: `{}`
default:: `{cert-manager.io/cluster-issuer: letsencrypt-production}`
example::
+
[source,yaml]
Expand Down
7 changes: 6 additions & 1 deletion tests/golden/oidc/oidc/oidc/10_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ spec:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations: {}
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
labels:
name: oidc
name: oidc
Expand All @@ -248,6 +249,10 @@ spec:
name: https
path: /
pathType: Prefix
tls:
- hosts:
- testcluster.local
secretName: oidc-tls
---
apiVersion: batch/v1
kind: Job
Expand Down

0 comments on commit 9682217

Please sign in to comment.