From ac5f47dcd401086f2ab517a6a75a65838e1d0cb3 Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Thu, 11 Jan 2024 12:32:29 -0800 Subject: [PATCH] Make hack/crossplane/config folder actually exist --- .devcontainer/install-dependencies.sh | 2 - hack/crossplane/.gitignore | 2 +- .../config/default/kustomization.yaml | 84 +++++++++++++++++++ 3 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 hack/crossplane/config/default/kustomization.yaml diff --git a/.devcontainer/install-dependencies.sh b/.devcontainer/install-dependencies.sh index f7f5671b677..49e9dee60ac 100755 --- a/.devcontainer/install-dependencies.sh +++ b/.devcontainer/install-dependencies.sh @@ -87,9 +87,7 @@ if [ "$DEVCONTAINER" = true ]; then BUILDX_DEST=/usr/lib/docker/cli-plugins else TOOL_DEST=$(git rev-parse --show-toplevel)/hack/tools - CROSSPLANE_CONFIG_DIR=$(git rev-parse --show-toplevel)/hack/crossplane/config mkdir -p "$TOOL_DEST" - mkdir -p "$CROSSPLANE_CONFIG_DIR" KUBEBUILDER_DEST="$TOOL_DEST/kubebuilder" BUILDX_DEST=$HOME/.docker/cli-plugins fi diff --git a/hack/crossplane/.gitignore b/hack/crossplane/.gitignore index f733c4b5fb4..b7b433e9d9a 100644 --- a/hack/crossplane/.gitignore +++ b/hack/crossplane/.gitignore @@ -1 +1 @@ -config/ +config/crd diff --git a/hack/crossplane/config/default/kustomization.yaml b/hack/crossplane/config/default/kustomization.yaml new file mode 100644 index 00000000000..6c5be117125 --- /dev/null +++ b/hack/crossplane/config/default/kustomization.yaml @@ -0,0 +1,84 @@ +# Adds namespace to all resources. +namespace: crossplane-system + +# Value of this field is prepended to the +# names of all resources, e.g. a deployment named +# "wordpress" becomes "alices-wordpress". +# Note that it should also match with the prefix (text before '-') of the namespace +# field above. + +# Labels to add to all resources and selectors. +#commonLabels: +# someName: someValue + +resources: [] + +bases: +- ../crd +- ../rbac +- ../manager +# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in crd/kustomization.yaml +# - ../webhook +# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. +- ../certmanager +# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. +#- ../prometheus + +patchesStrategicMerge: + # If you want your controller-manager to expose the /metrics + # endpoint w/o any authn/z, uncomment the following line and + # comment manager_auth_proxy_patch.yaml. + # Only one of manager_auth_proxy_patch.yaml and + # manager_prometheus_metrics_patch.yaml should be enabled. +#- manager_prometheus_metrics_patch.yaml + +# [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 + +# - manager_credentials_patch.yaml + +patches: +- patch: |- + - op: add + path: /spec/template/spec/containers/0/args/- + value: --webhook-port=9443 + - op: add + path: /spec/template/spec/containers/0/args/- + value: --webhook-cert-dir=/tmp/k8s-webhook-server/serving-certs + target: + kind: Deployment + +# 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