mirror of
https://github.com/cert-manager/webhook-example.git
synced 2025-07-01 22:35:49 +02:00
fix: 🐛 removed legacy apiversions and set it as static value
Removed go template condition with legacy api version value and set it as a static value
This commit is contained in:
parent
378611c874
commit
65e684870f
3 changed files with 8 additions and 11 deletions
|
@ -1,5 +1,4 @@
|
||||||
{{- $APIRegistrationAPIVersion := ternary "apiregistration.k8s.io/v1" "apiregistration.k8s.io/v1beta1" (.Capabilities.APIVersions.Has "apiregistration.k8s.io/v1") -}}
|
apiVersion: apiregistration.k8s.io/v1
|
||||||
apiVersion: {{ $APIRegistrationAPIVersion }}
|
|
||||||
kind: APIService
|
kind: APIService
|
||||||
metadata:
|
metadata:
|
||||||
name: v1alpha1.{{ include "dnsimple-webhook.api-group" . }}
|
name: v1alpha1.{{ include "dnsimple-webhook.api-group" . }}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{{- $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: {{ $CertManagerAPIVersion }}
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.selfSignedIssuer" . }}
|
name: {{ include "dnsimple-webhook.selfSignedIssuer" . }}
|
||||||
|
@ -18,7 +17,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: {{ $CertManagerAPIVersion }}
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.rootCACertificate" . }}
|
name: {{ include "dnsimple-webhook.rootCACertificate" . }}
|
||||||
|
@ -39,7 +38,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: {{ $CertManagerAPIVersion }}
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.rootCAIssuer" . }}
|
name: {{ include "dnsimple-webhook.rootCAIssuer" . }}
|
||||||
|
@ -56,7 +55,7 @@ spec:
|
||||||
---
|
---
|
||||||
|
|
||||||
# Finally, generate a serving certificate for the webhook to use
|
# Finally, generate a serving certificate for the webhook to use
|
||||||
apiVersion: {{ $CertManagerAPIVersion }}
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.servingCertificate" . }}
|
name: {{ include "dnsimple-webhook.servingCertificate" . }}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{{- $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:
|
||||||
|
@ -12,7 +11,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: {{ $RBACAPIVersion }}
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:webhook-authentication-reader
|
name: {{ include "dnsimple-webhook.fullname" . }}:webhook-authentication-reader
|
||||||
|
@ -34,7 +33,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: {{ $RBACAPIVersion }}
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:auth-delegator
|
name: {{ include "dnsimple-webhook.fullname" . }}:auth-delegator
|
||||||
|
@ -54,7 +53,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: {{ $RBACAPIVersion }}
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
|
||||||
|
|
Loading…
Reference in a new issue