mirror of
https://github.com/cert-manager/webhook-example.git
synced 2025-07-02 23:05:48 +02:00
Support newer stable APIs in Helm chart
- Switch from apiregistration.k8s.io/v1beta1 to apiregistration.k8s.io/v1 where available - Switch from rbac.authorization.k8s.io/v1beta1 to rbac.authorization.k8s.io/v1 where available - Switch from cert-manager.io/v1alpha2 to cert-manager.io/v1 where available
This commit is contained in:
parent
f4504a70e3
commit
e9100f8f63
3 changed files with 12 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
||||||
apiVersion: apiregistration.k8s.io/v1beta1
|
{{- $APIRegistrationAPIVersion := ternary "apiregistration.k8s.io/v1" "apiregistration.k8s.io/v1beta1" (.Capabilities.APIVersions.Has "apiregistration.k8s.io/v1") -}}
|
||||||
|
apiVersion: {{ $APIRegistrationAPIVersion }}
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1alpha1.{{ .Values.groupName }}
|
name: v1alpha1.{{ .Values.groupName }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
{{- $CertManagerAPIVersion := ternary "cert-manager.io/v1" "cert-manager.io/v1alpha2" (.Capabilities.APIVersions.Has "cert-manager.io/v1") -}}
|
||||||
---
|
---
|
||||||
# Create a selfsigned Issuer, in order to create a root CA certificate for
|
# Create a selfsigned Issuer, in order to create a root CA certificate for
|
||||||
# signing webhook serving certificates
|
# signing webhook serving certificates
|
||||||
apiVersion: cert-manager.io/v1alpha2
|
apiVersion: {{ $CertManagerAPIVersion }}
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.selfSignedIssuer" . }}
|
name: {{ include "dnsimple-webhook.selfSignedIssuer" . }}
|
||||||
|
@ -17,7 +18,7 @@ spec:
|
||||||
---
|
---
|
||||||
|
|
||||||
# Generate a CA Certificate used to sign certificates for the webhook
|
# Generate a CA Certificate used to sign certificates for the webhook
|
||||||
apiVersion: cert-manager.io/v1alpha2
|
apiVersion: {{ $CertManagerAPIVersion }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.rootCACertificate" . }}
|
name: {{ include "dnsimple-webhook.rootCACertificate" . }}
|
||||||
|
@ -38,7 +39,7 @@ spec:
|
||||||
---
|
---
|
||||||
|
|
||||||
# Create an Issuer that uses the above generated CA certificate to issue certs
|
# Create an Issuer that uses the above generated CA certificate to issue certs
|
||||||
apiVersion: cert-manager.io/v1alpha2
|
apiVersion: {{ $CertManagerAPIVersion }}
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.rootCAIssuer" . }}
|
name: {{ include "dnsimple-webhook.rootCAIssuer" . }}
|
||||||
|
@ -55,7 +56,7 @@ spec:
|
||||||
---
|
---
|
||||||
|
|
||||||
# Finally, generate a serving certificate for the webhook to use
|
# Finally, generate a serving certificate for the webhook to use
|
||||||
apiVersion: cert-manager.io/v1alpha2
|
apiVersion: {{ $CertManagerAPIVersion }}
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.servingCertificate" . }}
|
name: {{ include "dnsimple-webhook.servingCertificate" . }}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{{- $RBACAPIVersion := ternary "rbac.authorization.k8s.io/v1" "rbac.authorization.k8s.io/v1beta1" (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") -}}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -11,7 +12,7 @@ metadata:
|
||||||
# Grant the webhook permission to read the ConfigMap containing the Kubernetes
|
# Grant the webhook permission to read the ConfigMap containing the Kubernetes
|
||||||
# apiserver's requestheader-ca-certificate.
|
# apiserver's requestheader-ca-certificate.
|
||||||
# This ConfigMap is automatically created by the Kubernetes apiserver.
|
# This ConfigMap is automatically created by the Kubernetes apiserver.
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: {{ $RBACAPIVersion }}
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:webhook-authentication-reader
|
name: {{ include "dnsimple-webhook.fullname" . }}:webhook-authentication-reader
|
||||||
|
@ -33,7 +34,7 @@ subjects:
|
||||||
---
|
---
|
||||||
# apiserver gets the auth-delegator role to delegate auth decisions to
|
# apiserver gets the auth-delegator role to delegate auth decisions to
|
||||||
# the core apiserver
|
# the core apiserver
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: {{ $RBACAPIVersion }}
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:auth-delegator
|
name: {{ include "dnsimple-webhook.fullname" . }}:auth-delegator
|
||||||
|
@ -53,7 +54,7 @@ subjects:
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
---
|
---
|
||||||
# Grant cert-manager permission to validate using our apiserver
|
# Grant cert-manager permission to validate using our apiserver
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: {{ $RBACAPIVersion }}
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
||||||
|
@ -70,7 +71,7 @@ rules:
|
||||||
verbs:
|
verbs:
|
||||||
- 'create'
|
- 'create'
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: {{ $RBACAPIVersion }}
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
||||||
|
|
Loading…
Reference in a new issue