Added validation webhook,cert-manager,and updated Makefile.

- Scaffolded a new validation webhook using operator-sdk
- Added manifests for webhook.
- Added manifests for self signed issuer and certificates
- Added a new spec named ValidateSecurityWarnings to the Jenkins custom resource definition to enable/disable security check.
- Updated Makefile to deploy the operator locally.
- Updated helm template and default values.yaml
This commit is contained in:
sharmapulkit04
2021-06-30 20:34:51 +05:30
parent 63370a55cc
commit e87c7cac5f
15 changed files with 854 additions and 0 deletions
+21
View File
@@ -523,3 +523,24 @@ kubebuilder:
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.0/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR);
#TODO Integrate with master Makefile.
MANIFESTS := webhook/all_in_one_$(API_VERSION).yaml
all-in-one-build-webhook: ## Re-generate all-in-one yaml
@echo "+ $@"
> $(MANIFESTS)
cat webhook/rbac.yaml >> $(MANIFESTS)
cat webhook/operator.yaml >> $(MANIFESTS)
cat webhook/cert-manager.yaml >> $(MANIFESTS)
cat webhook/webhook.yaml >> $(MANIFESTS)
sed -i "s~{DOCKER_REGISTRY}:{GITCOMMIT}~${DOCKER_REGISTRY}:${GITCOMMIT}~;" ${MANIFESTS}
# start the cluster locally and set it to use the docker daemon from minikube
install-cert-manager: minikube-start
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.4.0/cert-manager.yaml
#Launch cert-manager and deploy the operator locally along with webhook
deploy-webhook: install-cert-manager install-crds container-runtime-build all-in-one-build-webhook
@echo "+ $@"
kubectl apply -f ${MANIFESTS}