-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Migrate away from deprecated kustomize features #3091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d3c4876
863072b
510e06c
c6acc27
1e6d80c
f7d0c7e
1e9da7c
781b0ca
448dd6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) | ||
# `default` and `serving-cert` may be substituted by kustomize | ||
cert-manager.io/inject-ca-from: default/serving-cert | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, behavior change. |
||
name: targetgroupbindings.elbv2.k8s.aws |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ kind: Certificate | |
metadata: | ||
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml | ||
spec: | ||
# $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize | ||
# `webhook-service` and `default` may be substituted by kustomize | ||
dnsNames: | ||
- $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc | ||
- $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local | ||
- webhook-service.default.svc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Behavior change, normally this webhook isn't in the default namespace |
||
- webhook-service.default.svc.cluster.local | ||
issuerRef: | ||
kind: Issuer | ||
name: selfsigned-issuer | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
resources: | ||
- certificate.yaml | ||
|
||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
configurations: | ||
- kustomizeconfig.yaml | ||
resources: | ||
- certificate.yaml | ||
patches: | ||
# patches here are for enabling the CA injection for each CRD | ||
- path: cainjection_in_targetgroupbindings_patch.yaml | ||
- path: cainjection_in_ingressclassparams_patch.yaml | ||
# This patch add annotation to admission webhook config, `default` and | ||
# `serving-cert` may be substituted by kustomize | ||
- target: | ||
kind: (MutatingWebhookConfiguration|ValidatingWebhookConfiguration) | ||
patch: |- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: dummy | ||
metadata: | ||
name: webhook | ||
annotations: | ||
cert-manager.io/inject-ca-from: default/serving-cert |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
# This configuration is for teaching kustomize how to update name ref and var substitution | ||
# This configuration is for teaching kustomize how to update name ref | ||
nameReference: | ||
- kind: Issuer | ||
group: cert-manager.io | ||
fieldSpecs: | ||
- kind: Certificate | ||
group: cert-manager.io | ||
path: spec/issuerRef/name | ||
|
||
varReference: | ||
- kind: Certificate | ||
group: cert-manager.io | ||
path: spec/commonName | ||
- kind: Certificate | ||
group: cert-manager.io | ||
path: spec/dnsNames |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,14 @@ apiVersion: v1 | |
kind: ServiceAccount | ||
metadata: | ||
name: controller | ||
labels: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this removed? |
||
app.kubernetes.io/component: controller | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller | ||
labels: | ||
app.kubernetes.io/component: controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/component: controller | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: controller | ||
spec: | ||
containers: | ||
- name: controller | ||
|
@@ -34,6 +24,16 @@ spec: | |
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
ports: | ||
- containerPort: 9443 | ||
name: webhook | ||
protocol: TCP | ||
- containerPort: 8080 | ||
name: metrics | ||
protocol: TCP | ||
- containerPort: 61779 | ||
name: healthprobe | ||
protocol: TCP | ||
livenessProbe: | ||
failureThreshold: 2 | ||
httpGet: | ||
|
@@ -44,4 +44,4 @@ spec: | |
timeoutSeconds: 10 | ||
terminationGracePeriodSeconds: 10 | ||
priorityClassName: system-cluster-critical | ||
serviceAccountName: controller | ||
serviceAccountName: controller |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
# the following config is for teaching kustomize how to do kustomization for CRDs. | ||
configurations: | ||
- kustomizeconfig.yaml | ||
|
||
# This kustomization.yaml is not intended to be run by itself, | ||
# since it depends on service name and namespace that are out of this kustomize package. | ||
# It should be run by config/default | ||
resources: | ||
- bases/elbv2.k8s.aws_targetgroupbindings.yaml | ||
- bases/elbv2.k8s.aws_ingressclassparams.yaml | ||
# +kubebuilder:scaffold:crdkustomizeresource | ||
|
||
patchesStrategicMerge: | ||
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. | ||
# patches here are for enabling the conversion webhook for each CRD | ||
#- patches/webhook_in_targetgroupbindings.yaml | ||
#- patches/webhook_in_ingressclassparams.yaml | ||
# +kubebuilder:scaffold:crdkustomizewebhookpatch | ||
|
||
# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix. | ||
# patches here are for enabling the CA injection for each CRD | ||
#- patches/cainjection_in_targetgroupbindings.yaml | ||
#- patches/cainjection_in_ingressclassparams.yaml | ||
# +kubebuilder:scaffold:crdkustomizecainjectionpatch | ||
|
||
# the following config is for teaching kustomize how to do kustomization for CRDs. | ||
configurations: | ||
- kustomizeconfig.yaml |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- monitor.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- role.yaml | ||
- role_binding.yaml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a behavior change