Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #698 from fao89/kustomize
Browse files Browse the repository at this point in the history
Replace samples with kustomize examples
  • Loading branch information
openshift-merge-bot[bot] authored Mar 5, 2024
2 parents 6e4c4fe + fe9ed9f commit 83d9955
Show file tree
Hide file tree
Showing 48 changed files with 1,874 additions and 885 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/kustom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Kustomize Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- config/samples/**
- examples/**
jobs:
kustomize:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
fetch-depth: 0
- name: kustomize build
run: |
make kustomize
cd examples
for d in */ ; do
echo "=============== $d ==============="
../bin/kustomize build "$d"
done
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
KUTTL ?= $(LOCALBIN)/kubectl-kuttl

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
KUSTOMIZE_VERSION ?= v5.0.1
CONTROLLER_TOOLS_VERSION ?= v0.11.1
CRD_MARKDOWN_VERSION ?= v0.0.3
KUTTL_VERSION ?= 0.15.0
Expand Down
25 changes: 14 additions & 11 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@ resources:
- bases/dataplane.openstack.org_openstackdataplanedeployments.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
patches:
# [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_openstackdataplanes.yaml
#- patches/webhook_in_openstackdataplaneroles.yaml
#- patches/webhook_in_openstackdataplanenodes.yaml
#- patches/webhook_in_openstackdataplaneservices.yaml
#- patches/webhook_in_openstackdataplanedeployments.yaml
#- path: patches/webhook_in_openstackdataplanes.yaml
#- path: patches/webhook_in_openstackdataplaneroles.yaml
#- path: patches/webhook_in_openstackdataplanenodes.yaml
#- path: patches/webhook_in_openstackdataplaneservices.yaml
#- path: patches/webhook_in_openstackdataplanedeployments.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_openstackdataplanes.yaml
#- patches/cainjection_in_openstackdataplaneroles.yaml
#- patches/cainjection_in_openstackdataplanenodes.yaml
#- patches/cainjection_in_openstackdataplaneservices.yaml
#- patches/cainjection_in_openstackdataplanedeployments.yaml
#- path: patches/cainjection_in_openstackdataplanes.yaml
#- path: patches/cainjection_in_openstackdataplaneroles.yaml
#- path: patches/cainjection_in_openstackdataplanenodes.yaml
#- path: patches/cainjection_in_openstackdataplaneservices.yaml
#- path: patches/cainjection_in_openstackdataplanedeployments.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
18 changes: 11 additions & 7 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namePrefix: dataplane-operator-
#commonLabels:
# someName: someValue

bases:
resources:
- ../crd
- ../rbac
- ../manager
Expand All @@ -24,27 +24,28 @@ 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

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
#- manager_config_patch.yaml
#- path: manager_config_patch.yaml

# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- manager_webhook_patch.yaml
- path: 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: mutatingwebhookcainjection_patch.yaml
- path: validatingwebhookcainjection_patch.yaml

# Injects our custom images (ENV variable settings)
- manager_default_images.yaml
- path: manager_default_images.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
Expand Down Expand Up @@ -75,3 +76,6 @@ vars:
# kind: Service
# version: v1
# name: webhook-service

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
15 changes: 15 additions & 0 deletions config/default/mutatingwebhookcainjection_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This patch add annotation to admission webhook config and
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
labels:
app.kubernetes.io/name: mutatingwebhookconfiguration
app.kubernetes.io/instance: mutating-webhook-configuration
app.kubernetes.io/component: webhook
app.kubernetes.io/created-by: dataplane-operator
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
name: mutating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# This patch add annotation to admission webhook config and
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
labels:
app.kubernetes.io/name: mutatingwebhookconfiguration
app.kubernetes.io/instance: mutating-webhook-configuration
app.kubernetes.io/component: webhook
app.kubernetes.io/created-by: dataplane-operator
app.kubernetes.io/part-of: dataplane-operator
app.kubernetes.io/managed-by: kustomize
name: mutating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
labels:
Expand Down
4 changes: 3 additions & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ resources:
# [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix.
# Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager.
# These patches remove the unnecessary "cert" volume and its manager container volumeMount.
#patchesJson6902:
# apiVersion: kustomize.config.k8s.io/v1beta1
# kind: Kustomization
# patches:
#- target:
# group: apps
# version: v1
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
- validate-network
- install-os
- configure-os
- ssh-known-hosts
- run-os
- reboot-os
- install-certs
Expand Down Expand Up @@ -41,6 +42,10 @@ spec:
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
ansible:
ansibleVars:
# CHANGEME -- see https://access.redhat.com/solutions/253273
# edpm_bootstrap_command: |
# subscription-manager register --username <subscription_manager_username> --password <subscription_manager_password>
# podman login -u <registry_username> -p <registry_password> registry.redhat.io
edpm_network_config_template: |
---
{% set mtu_list = [ctlplane_mtu] %}
Expand Down
147 changes: 0 additions & 147 deletions config/samples/dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml

This file was deleted.

Loading

0 comments on commit 83d9955

Please sign in to comment.