Skip to content

Commit

Permalink
Merge pull request #125 from Madhu-1/artifacts
Browse files Browse the repository at this point in the history
Generate multifile installer
  • Loading branch information
nb-ohad authored Sep 4, 2024
2 parents 8d05369 + c17ffd8 commit b69a93a
Show file tree
Hide file tree
Showing 11 changed files with 30,607 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
go-version-file: go.mod
- name: run make build
run: make build
- name: make build installer
run: make build-installer
- name: run build multifile installer
run: make build-multifile-installer
- name: Check for uncommitted changes
run: make check-all-committed
- name: Show the uncommitted "git diff"
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

# Define the content of the temporary top-most kustomize overlay for the
# build-installer and deploy targets
# build-installer, build-multifile-installer and deploy targets
define BUILD_INSTALLER_OVERLAY
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand All @@ -55,8 +55,6 @@ images:
newName: ${IMG}
- name: kube-rbac-proxy
newName: ${KUBE_RBAC_PROXY_IMG}
resources:
- ../config/default
endef
export BUILD_INSTALLER_OVERLAY

Expand Down Expand Up @@ -168,17 +166,28 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p build dist
mkdir -p build deploy/all-in-one
cd build && echo "$$BUILD_INSTALLER_OVERLAY" > kustomization.yaml
$(KUSTOMIZE) build build > dist/install.yaml
cd build && $(KUSTOMIZE) edit add resource ../config/default/
$(KUSTOMIZE) build build > deploy/all-in-one/install.yaml
rm -rf build

.PHONY: build-multifile-installer
build-multifile-installer: build-csi-rbac manifests generate kustomize
mkdir -p build deploy/multifile
$(KUSTOMIZE) build config/crd > deploy/multifile/crd.yaml
cd build && echo "$$BUILD_INSTALLER_OVERLAY" > kustomization.yaml
cd build && $(KUSTOMIZE) edit add resource ../config/rbac ../config/manager
$(KUSTOMIZE) build build > deploy/multifile/operator.yaml
rm -rf build

.PHONY: build-csi-rbac
build-csi-rbac:
mkdir -p build dist
mkdir -p build deploy/multifile
cd build && echo "$$BUILD_CSI_RBAC_OVERLAY" > kustomization.yaml
$(KUSTOMIZE) build build > dist/csi-rbac.yaml
$(KUSTOMIZE) build build > deploy/multifile/csi-rbac.yaml
rm -rf build

##@ Deployment

ifndef ignore-not-found
Expand All @@ -197,6 +206,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
mkdir -p build
cd build && echo "$$BUILD_INSTALLER_OVERLAY" > kustomization.yaml
cd build && $(KUSTOMIZE) edit add resource ../config/default/
$(KUSTOMIZE) build build | $(KUBECTL) apply -f -
rm -rf build

Expand Down
7 changes: 1 addition & 6 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

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.
- path: manager_auth_proxy_patch.yaml

#patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- path: manager_webhook_patch.yaml
Expand Down
5 changes: 5 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
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.
- path: manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This file was originally located in config/default, but it has been moved here to Kustomize exclusively for deployment.
# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This file was originally located in config/default, but it has been moved here to Kustomize exclusively for deployment.
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
Loading

0 comments on commit b69a93a

Please sign in to comment.