scaffold controller
This commit is contained in:
24
config/certmanager/certificate.yaml
Normal file
24
config/certmanager/certificate.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
# The following manifests contain a self-signed issuer CR and a certificate CR.
|
||||
# More document can be found at https://docs.cert-manager.io
|
||||
apiVersion: certmanager.k8s.io/v1alpha1
|
||||
kind: Issuer
|
||||
metadata:
|
||||
name: selfsigned-issuer
|
||||
namespace: system
|
||||
spec:
|
||||
selfSigned: {}
|
||||
---
|
||||
apiVersion: certmanager.k8s.io/v1alpha1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
|
||||
namespace: system
|
||||
spec:
|
||||
# $(SERVICENAME) and $(NAMESPACE) will be substituted by kustomize
|
||||
commonName: $(SERVICENAME).$(NAMESPACE).svc
|
||||
dnsNames:
|
||||
- $(SERVICENAME).$(NAMESPACE).svc.cluster.local
|
||||
issuerRef:
|
||||
kind: Issuer
|
||||
name: selfsigned-issuer
|
||||
secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize
|
26
config/certmanager/kustomization.yaml
Normal file
26
config/certmanager/kustomization.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
resources:
|
||||
- certificate.yaml
|
||||
|
||||
# the following config is for teaching kustomize how to do var substitution
|
||||
vars:
|
||||
- name: NAMESPACE # namespace of the service and the certificate CR
|
||||
objref:
|
||||
kind: Service
|
||||
version: v1
|
||||
name: webhook-service
|
||||
fieldref:
|
||||
fieldpath: metadata.namespace
|
||||
- name: CERTIFICATENAME
|
||||
objref:
|
||||
kind: Certificate
|
||||
group: certmanager.k8s.io
|
||||
version: v1alpha1
|
||||
name: serving-cert # this name should match the one in certificate.yaml
|
||||
- name: SERVICENAME
|
||||
objref:
|
||||
kind: Service
|
||||
version: v1
|
||||
name: webhook-service
|
||||
|
||||
configurations:
|
||||
- kustomizeconfig.yaml
|
16
config/certmanager/kustomizeconfig.yaml
Normal file
16
config/certmanager/kustomizeconfig.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
# This configuration is for teaching kustomize how to update name ref and var substitution
|
||||
nameReference:
|
||||
- kind: Issuer
|
||||
group: certmanager.k8s.io
|
||||
fieldSpecs:
|
||||
- kind: Certificate
|
||||
group: certmanager.k8s.io
|
||||
path: spec/issuerRef/name
|
||||
|
||||
varReference:
|
||||
- kind: Certificate
|
||||
group: certmanager.k8s.io
|
||||
path: spec/commonName
|
||||
- kind: Certificate
|
||||
group: certmanager.k8s.io
|
||||
path: spec/dnsNames
|
Reference in New Issue
Block a user