-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: use of kustomize deprecated features #52
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: sample-external-issuer | ||
app.kubernetes.io/managed-by: kustomize | ||
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml | ||
namespace: system | ||
spec: | ||
# SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize | ||
# replacements in the config/default/kustomization.yaml file. | ||
dnsNames: | ||
- SERVICE_NAME.SERVICE_NAMESPACE.svc | ||
- SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local | ||
issuerRef: | ||
kind: Issuer | ||
name: selfsigned-issuer | ||
secretName: webhook-server-cert |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# The following manifest contains a self-signed issuer CR. | ||
# More information can be found at https://docs.cert-manager.io | ||
# WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes. | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: sample-external-issuer | ||
app.kubernetes.io/managed-by: kustomize | ||
name: selfsigned-issuer | ||
namespace: system | ||
spec: | ||
selfSigned: {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
resources: | ||
- certificate.yaml | ||
- issuer.yaml | ||
- certificate-webhook.yaml | ||
|
||
configurations: | ||
- kustomizeconfig.yaml |
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 substitution | ||
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 |
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. Reflects the upstream changes which were introduced in: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,3 @@ namespace: | |
group: apiextensions.k8s.io | ||
path: spec/conversion/webhookClientConfig/service/namespace | ||
create: false | ||
|
||
varReference: | ||
- path: metadata/annotations | ||
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? It is still in the kubebuilder skaffolding AFAICS: |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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 did these filenames change? Is it because the CRD name was changed in #42 and we forgot to re-run the kubebuilder crd generator tool? If so, it really annoys me that issuer-lib prevents us from using the CRD name |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# The following patch enables a conversion webhook for the CRD | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: sampleclusterissuers.sample-issuer.example.com | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
clientConfig: | ||
service: | ||
namespace: system | ||
name: webhook-service | ||
path: /convert | ||
conversionReviewVersions: | ||
- v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# The following patch enables a conversion webhook for the CRD | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: sampleissuers.sample-issuer.example.com | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
clientConfig: | ||
service: | ||
namespace: system | ||
name: webhook-service | ||
path: /convert | ||
conversionReviewVersions: | ||
- v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ namePrefix: sample-external-issuer- | |
#commonLabels: | ||
# someName: someValue | ||
|
||
bases: | ||
resources: | ||
- ../crd | ||
- ../rbac | ||
- ../manager | ||
|
@@ -24,49 +24,143 @@ bases: | |
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. | ||
#- ../prometheus | ||
|
||
patchesStrategicMerge: | ||
patches: | ||
# Protect the /metrics endpoint by putting it behind auth. | ||
# If you want your controller-manager to expose the /metrics | ||
# endpoint w/o any authn/z, please comment the following line. | ||
- manager_auth_proxy_patch.yaml | ||
|
||
|
||
- path: manager_auth_proxy_patch.yaml | ||
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. I expected this patch to change or be deleted, since it's what adds the kube-rbac-proxy sidecar: Did you forget to commit something? 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. I could extend the PR to include migration away from 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. Oh, I misunderstood your PR description.
I thought you meant that you'd removed kube-rbac-proxy and additionally replaced some deprecated kustomize features. Now I understand that this PR is ground work for a follow up PR which removes kube-rbac-proxy. |
||
|
||
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in | ||
# crd/kustomization.yaml | ||
#- manager_webhook_patch.yaml | ||
|
||
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. | ||
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. | ||
# 'CERTMANAGER' needs to be enabled to use ca injection | ||
#- webhookcainjection_patch.yaml | ||
#- path: manager_webhook_patch.yaml | ||
|
||
# the following config is for teaching kustomize how to do var substitution | ||
vars: | ||
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. | ||
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
#- name: CERTIFICATE_NAME | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
#- name: SERVICE_NAMESPACE # namespace of the service | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
#- name: SERVICE_NAME | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# Uncomment the following replacements to add the cert-manager CA injection annotations | ||
#replacements: | ||
# - source: # Uncomment the following block if you have any webhook | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# fieldPath: .metadata.name # Name of the service | ||
# targets: | ||
# - select: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# fieldPaths: | ||
# - .spec.dnsNames.0 | ||
# - .spec.dnsNames.1 | ||
# options: | ||
# delimiter: '.' | ||
# index: 0 | ||
# create: true | ||
# - source: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# fieldPath: .metadata.namespace # Namespace of the service | ||
# targets: | ||
# - select: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# fieldPaths: | ||
# - .spec.dnsNames.0 | ||
# - .spec.dnsNames.1 | ||
# options: | ||
# delimiter: '.' | ||
# index: 1 | ||
# create: true | ||
# | ||
# - source: # Uncomment the following block if you have a ValidatingWebhook (--programmatic-validation) | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.namespace # Namespace of the certificate CR | ||
# targets: | ||
# - select: | ||
# kind: ValidatingWebhookConfiguration | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 0 | ||
# create: true | ||
# - source: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.name | ||
# targets: | ||
# - select: | ||
# kind: ValidatingWebhookConfiguration | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 1 | ||
# create: true | ||
# | ||
# - source: # Uncomment the following block if you have a DefaultingWebhook (--defaulting ) | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.namespace # Namespace of the certificate CR | ||
# targets: | ||
# - select: | ||
# kind: MutatingWebhookConfiguration | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 0 | ||
# create: true | ||
# - source: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.name | ||
# targets: | ||
# - select: | ||
# kind: MutatingWebhookConfiguration | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 1 | ||
# create: true | ||
# | ||
# - source: # Uncomment the following block if you have a ConversionWebhook (--conversion) | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.namespace # Namespace of the certificate CR | ||
# targets: | ||
# - select: | ||
# kind: CustomResourceDefinition | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 0 | ||
# create: true | ||
# - source: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # This name should match the one in certificate.yaml | ||
# fieldPath: .metadata.name | ||
# targets: | ||
# - select: | ||
# kind: CustomResourceDefinition | ||
# fieldPaths: | ||
# - .metadata.annotations.[cert-manager.io/inject-ca-from] | ||
# options: | ||
# delimiter: '/' | ||
# index: 1 | ||
# create: true |
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.
Looks like this new file was renamed from the original certificate.yaml in kubernetes-sigs/kubebuilder#4400 👍