Skip to content

Commit 687d533

Browse files
authored
Merge pull request #16 from Peltarion/parmus/helm
feat: support newer stable APIs in Helm chart
2 parents f4504a7 + e9100f8 commit 687d533

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

deploy/dnsimple/templates/apiservice.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
apiVersion: apiregistration.k8s.io/v1beta1
1+
{{- $APIRegistrationAPIVersion := ternary "apiregistration.k8s.io/v1" "apiregistration.k8s.io/v1beta1" (.Capabilities.APIVersions.Has "apiregistration.k8s.io/v1") -}}
2+
apiVersion: {{ $APIRegistrationAPIVersion }}
23
kind: APIService
34
metadata:
45
name: v1alpha1.{{ .Values.groupName }}

deploy/dnsimple/templates/pki.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
{{- $CertManagerAPIVersion := ternary "cert-manager.io/v1" "cert-manager.io/v1alpha2" (.Capabilities.APIVersions.Has "cert-manager.io/v1") -}}
12
---
23
# Create a selfsigned Issuer, in order to create a root CA certificate for
34
# signing webhook serving certificates
4-
apiVersion: cert-manager.io/v1alpha2
5+
apiVersion: {{ $CertManagerAPIVersion }}
56
kind: Issuer
67
metadata:
78
name: {{ include "dnsimple-webhook.selfSignedIssuer" . }}
@@ -17,7 +18,7 @@ spec:
1718
---
1819

1920
# Generate a CA Certificate used to sign certificates for the webhook
20-
apiVersion: cert-manager.io/v1alpha2
21+
apiVersion: {{ $CertManagerAPIVersion }}
2122
kind: Certificate
2223
metadata:
2324
name: {{ include "dnsimple-webhook.rootCACertificate" . }}
@@ -38,7 +39,7 @@ spec:
3839
---
3940

4041
# Create an Issuer that uses the above generated CA certificate to issue certs
41-
apiVersion: cert-manager.io/v1alpha2
42+
apiVersion: {{ $CertManagerAPIVersion }}
4243
kind: Issuer
4344
metadata:
4445
name: {{ include "dnsimple-webhook.rootCAIssuer" . }}
@@ -55,7 +56,7 @@ spec:
5556
---
5657

5758
# Finally, generate a serving certificate for the webhook to use
58-
apiVersion: cert-manager.io/v1alpha2
59+
apiVersion: {{ $CertManagerAPIVersion }}
5960
kind: Certificate
6061
metadata:
6162
name: {{ include "dnsimple-webhook.servingCertificate" . }}

deploy/dnsimple/templates/rbac.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- $RBACAPIVersion := ternary "rbac.authorization.k8s.io/v1" "rbac.authorization.k8s.io/v1beta1" (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") -}}
12
apiVersion: v1
23
kind: ServiceAccount
34
metadata:
@@ -11,7 +12,7 @@ metadata:
1112
# Grant the webhook permission to read the ConfigMap containing the Kubernetes
1213
# apiserver's requestheader-ca-certificate.
1314
# This ConfigMap is automatically created by the Kubernetes apiserver.
14-
apiVersion: rbac.authorization.k8s.io/v1beta1
15+
apiVersion: {{ $RBACAPIVersion }}
1516
kind: RoleBinding
1617
metadata:
1718
name: {{ include "dnsimple-webhook.fullname" . }}:webhook-authentication-reader
@@ -33,7 +34,7 @@ subjects:
3334
---
3435
# apiserver gets the auth-delegator role to delegate auth decisions to
3536
# the core apiserver
36-
apiVersion: rbac.authorization.k8s.io/v1beta1
37+
apiVersion: {{ $RBACAPIVersion }}
3738
kind: ClusterRoleBinding
3839
metadata:
3940
name: {{ include "dnsimple-webhook.fullname" . }}:auth-delegator
@@ -53,7 +54,7 @@ subjects:
5354
namespace: {{ .Release.Namespace }}
5455
---
5556
# Grant cert-manager permission to validate using our apiserver
56-
apiVersion: rbac.authorization.k8s.io/v1beta1
57+
apiVersion: {{ $RBACAPIVersion }}
5758
kind: ClusterRole
5859
metadata:
5960
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver
@@ -70,7 +71,7 @@ rules:
7071
verbs:
7172
- 'create'
7273
---
73-
apiVersion: rbac.authorization.k8s.io/v1beta1
74+
apiVersion: {{ $RBACAPIVersion }}
7475
kind: ClusterRoleBinding
7576
metadata:
7677
name: {{ include "dnsimple-webhook.fullname" . }}:domain-solver

0 commit comments

Comments
 (0)