feat(tls): Change Issuer to ClusterIssuer
ClusterIssuer does not belong to a single namespace (unlike Issuer) and can be referenced by Certificate resources from multiple different namespaces. When internal TLS is added to multiple namespaces, same ClusterIssuer can be used instead of one Issuer per namespace. Change-Id: I1576f486f30d693c4bc6b15e25c238d8004b4568
This commit is contained in:
parent
25aa369025
commit
f60c94fc16
20
ca-clusterissuer/Chart.yaml
Normal file
20
ca-clusterissuer/Chart.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
description: Certificate Issuer chart for OSH
|
||||
home: https://cert-manager.io/
|
||||
name: ca-clusterissuer
|
||||
version: 0.1.0
|
||||
...
|
18
ca-clusterissuer/requirements.yaml
Normal file
18
ca-clusterissuer/requirements.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
---
|
||||
dependencies:
|
||||
- name: helm-toolkit
|
||||
repository: http://localhost:8879/charts
|
||||
version: ">= 0.1.0"
|
||||
...
|
28
ca-clusterissuer/templates/clusterissuer-ca.yaml
Normal file
28
ca-clusterissuer/templates/clusterissuer-ca.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- if .Values.manifests.clusterissuer }}
|
||||
{{- $envAll := . }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: {{ .Values.conf.ca.issuer.name }}
|
||||
labels:
|
||||
{{ tuple $envAll "cert-manager" "clusterissuer" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
spec:
|
||||
ca:
|
||||
secretName: {{ .Values.conf.ca.secret.name }}
|
||||
...
|
||||
{{- end }}
|
26
ca-clusterissuer/templates/secret-ca.yaml
Normal file
26
ca-clusterissuer/templates/secret-ca.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- if .Values.manifests.secret_ca }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.conf.ca.secret.name }}
|
||||
namespace: {{ .Values.conf.ca.secret.namespace }}
|
||||
data:
|
||||
tls.crt: {{ .Values.conf.ca.secret.crt | default "" | b64enc }}
|
||||
tls.key: {{ .Values.conf.ca.secret.key | default "" | b64enc }}
|
||||
...
|
||||
{{- end }}
|
27
ca-clusterissuer/values.yaml
Normal file
27
ca-clusterissuer/values.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
---
|
||||
conf:
|
||||
ca:
|
||||
issuer:
|
||||
name: ca-issuer
|
||||
secret:
|
||||
name: secret-name
|
||||
# Namespace where cert-manager is deployed.
|
||||
namespace: cert-manager
|
||||
crt: null
|
||||
key: null
|
||||
|
||||
manifests:
|
||||
clusterissuer: true
|
||||
secret_ca: true
|
||||
...
|
@ -16,5 +16,5 @@ appVersion: "1.0"
|
||||
description: Certificate Issuer chart for OSH
|
||||
home: https://cert-manager.io/
|
||||
name: ca-issuer
|
||||
version: 0.1.1
|
||||
version: 0.1.2
|
||||
...
|
||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||
{{- if .Values.manifests.issuer }}
|
||||
{{- $envAll := . }}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1alpha3
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Issuer
|
||||
metadata:
|
||||
name: {{ .Values.conf.ca.issuer.name }}
|
||||
|
@ -15,7 +15,7 @@ apiVersion: v1
|
||||
appVersion: v1.0.0
|
||||
description: OpenStack-Helm Helm-Toolkit
|
||||
name: helm-toolkit
|
||||
version: 0.2.0
|
||||
version: 0.2.1
|
||||
home: https://docs.openstack.org/openstack-helm
|
||||
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
|
||||
sources:
|
||||
|
@ -43,7 +43,7 @@ examples:
|
||||
{{ $opts | include "helm-toolkit.manifests.certificates" }}
|
||||
return: |
|
||||
---
|
||||
apiVersion: cert-manager.io/v1alpha3
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: keystone-tls-api
|
||||
@ -94,7 +94,7 @@ examples:
|
||||
{{- $_ := (list "server auth" "client auth") | set (index $envAll.Values.endpoints $service "host_fqdn_override" "default" "tls") "usages" -}}
|
||||
{{- end -}}
|
||||
---
|
||||
apiVersion: cert-manager.io/v1alpha3
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ index $envAll.Values.endpoints $service "host_fqdn_override" "default" "tls" "secretName" }}
|
||||
|
@ -554,9 +554,9 @@ examples:
|
||||
{{- $backendPort := index . "backendPort" -}}
|
||||
{{- $endpoint := index . "endpoint" | default "public" -}}
|
||||
{{- $certIssuer := index . "certIssuer" | default "" -}}
|
||||
{{- $certIssuerType := index . "certIssuerType" | default "issuer" -}}
|
||||
{{- $certIssuerType := index . "certIssuerType" | default "cluster-issuer" -}}
|
||||
{{- if and (ne $certIssuerType "issuer") (ne $certIssuerType "cluster-issuer") }}
|
||||
{{- $certIssuerType = "issuer" -}}
|
||||
{{- $certIssuerType = "cluster-issuer" -}}
|
||||
{{- end }}
|
||||
{{- $ingressName := tuple $backendServiceType $endpoint $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
{{- $backendName := tuple $backendServiceType "internal" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
|
@ -15,7 +15,7 @@ apiVersion: v1
|
||||
appVersion: v10.2.31
|
||||
description: OpenStack-Helm MariaDB
|
||||
name: mariadb
|
||||
version: 0.1.5
|
||||
version: 0.1.6
|
||||
home: https://mariadb.com/kb/en/
|
||||
icon: http://badges.mariadb.org/mariadb-badge-180x60.png
|
||||
sources:
|
||||
|
@ -17,7 +17,7 @@ endpoints:
|
||||
secretName: mariadb-tls-direct
|
||||
issuerRef:
|
||||
name: ca-issuer
|
||||
kind: Issuer
|
||||
kind: ClusterIssuer
|
||||
manifests:
|
||||
certificates: true
|
||||
...
|
||||
|
Loading…
Reference in New Issue
Block a user