Skip to content

Commit d2a74be

Browse files
Merge pull request #52 from matyasselmeci/pr/certmanager.SOFTWARE-6247
osg-hosted-ce: create Certificate object if requested (SOFTWARE-6247)
2 parents 1a1e84f + 4dd875c commit d2a74be

File tree

5 files changed

+53
-9
lines changed

5 files changed

+53
-9
lines changed

supported/osg-htc/osg-hosted-ce/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ apiVersion: v1
33
appVersion: "V5-branch"
44
description: OSG Hosted Compute Entrypoint
55
name: osg-hosted-ce
6-
version: 4.14.0
6+
version: 4.15.0

supported/osg-htc/osg-hosted-ce/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ Create chart name and version as used by the chart label.
2626
{{- define "osg-hosted-ce.chart" -}}
2727
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
2828
{{- end -}}
29+
30+
{{/*
31+
Default host cert/key secret name.
32+
*/}}
33+
{{- define "osg-hosted-ce.certname" -}}
34+
{{- if .Values.HostCredentials.HostCertKeySecret -}}
35+
{{- .Values.HostCredentials.HostCertKeySecret -}}
36+
{{- else -}}
37+
{{ include "osg-hosted-ce.name" . }}-gencert
38+
{{- end -}}
39+
{{- end -}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{ if .Values.HostCredentials.CreateCertificate }}
2+
apiVersion: cert-manager.io/v1
3+
kind: Certificate
4+
metadata:
5+
labels:
6+
app: {{ template "osg-hosted-ce.name" . }}
7+
release: {{ .Release.Name }}
8+
instance: {{ .Values.Instance }}
9+
app.kubernetes.io/part-of: {{ .Chart.Name }}
10+
app.kubernetes.io/instance: {{ .Release.Name }}
11+
name: {{ template "osg-hosted-ce.certname" . }}
12+
spec:
13+
commonName: {{ .Values.Networking.Hostname }}
14+
usages:
15+
- server auth
16+
- client auth
17+
dnsNames:
18+
- {{ .Values.Networking.Hostname }}
19+
issuerRef:
20+
name: {{ .Values.HostCredentials.CertificateIssuer }}
21+
kind: {{ .Values.HostCredentials.CertificateIssuerKind }}
22+
secretName: {{ template "osg-hosted-ce.certname" . }}
23+
{{ end }}

supported/osg-htc/osg-hosted-ce/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ spec:
8383
configMap:
8484
name: osg-hosted-ce-{{ .Values.Instance }}-known-hosts
8585
{{ end }}
86-
{{ if .Values.HostCredentials.HostCertKeySecret }}
86+
{{ if or .Values.HostCredentials.HostCertKeySecret .Values.HostCredentials.CreateCertificate }}
8787
- name: osg-hosted-ce-hostcertkey-volume
8888
secret:
89-
secretName: {{ .Values.HostCredentials.HostCertKeySecret }}
89+
secretName: {{ template "osg-hosted-ce.certname" . }}
9090
items:
9191
- key: tls.crt
9292
path: hostcert.pem
@@ -156,7 +156,7 @@ spec:
156156
- name: lib-condor-ce
157157
mountPath: /var/lib/condor-ce
158158
{{ end }}
159-
{{ if .Values.HostCredentials.HostCertKeySecret }}
159+
{{ if or .Values.HostCredentials.HostCertKeySecret .Values.HostCredentials.CreateCertificate }}
160160
- name: osg-hosted-ce-hostcertkey-volume
161161
mountPath: /etc/grid-security-orig.d
162162
{{ end }}

supported/osg-htc/osg-hosted-ce/values.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,23 @@ NodeSelection:
196196
ServiceAnnotations: {}
197197

198198
HostCredentials:
199+
# If set to 'true', will create a CertManager Certificate object.
200+
CreateCertificate: false
201+
# Set this to the name of the ClusterIssuer on your cluster for
202+
# creating Let's Encrypt certificates.
203+
# No effect if CreateCertificate is 'false'.
204+
# The currently available issuers are:
205+
# 'letsencrypt-prod-newchain' (tiger); 'letsencrypt-prod-osg' (tempest);
206+
# 'i2-eab-issuer', 'nrp-org-cloudflare-issuer' (nautilus)
207+
CertificateIssuer: letsencrypt-prod-newchain
208+
# Set this to ClusterIssuer or Issuer depending on whether the issuer above
209+
# is cluster-wide or part of the namespace.
210+
CertificateIssuerKind: ClusterIssuer
199211
# Name of the secret containing a host key and certificate in
200-
# "tls.key" and "tls.crt", respectively.
212+
# "tls.key" and "tls.crt", respectively.
213+
# If CreateCertificate is 'true', but HostCertKeySecret is null,
214+
# a default name will be used.
201215
HostCertKeySecret: null
202-
# If set to 'true', use the Let's Encrypt staging server. This is
203-
# useful for avoiding Let's Encrypt rate limits when first setting
204-
# up a CE. NOT SUITABLE FOR PRODUCTION USE.
205-
LetsEncryptStaging: false
206216

207217
# Choose which tag to use for the specified containers
208218
ContainerTags:

0 commit comments

Comments
 (0)