Skip to content

Commit

Permalink
chore: add ingress support when deploying chart locally (#95)
Browse files Browse the repository at this point in the history
* chore: add ingress support when deploying chart locally

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

---------

Signed-off-by: Charles-Edouard Brétéché <[email protected]>
  • Loading branch information
eddycharly authored May 14, 2023
1 parent ca2b2dc commit 3a5a8dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ KIND_IMAGE ?= kindest/node:v1.26.3
KIND_NAME ?= kind
KYVERNO_VERSION ?= 3.0.0-alpha.2
KOCACHE ?= /tmp/ko-cache
USE_CONFIG ?= standard

#############
# VARIABLES #
Expand All @@ -25,8 +26,9 @@ PLATFORMS := linux/arm64,linux/amd64
KO_PLATFORMS := all
PLAYGROUND_IMAGE := playground
REPO_PLAYGROUND := $(REGISTRY)/$(REPO)/$(PLAYGROUND_IMAGE)

KO_REGISTRY := ko.local
COMMA := ,

ifndef VERSION
KO_TAGS := $(GIT_SHA)
else ifeq ($(VERSION),main)
Expand Down Expand Up @@ -168,7 +170,8 @@ kind-install: $(HELM) ## Install playground helm chart
@$(HELM) upgrade --install kyverno --namespace kyverno --create-namespace --wait ./charts/kyverno-playground \
--set image.registry=$(KO_REGISTRY) \
--set image.repository=github.com/kyverno/playground/backend \
--set image.tag=$(GIT_SHA)
--set image.tag=$(GIT_SHA) \
$(foreach CONFIG,$(subst $(COMMA), ,$(USE_CONFIG)),--values ./scripts/config/$(CONFIG)/kyverno-playground.yaml)

.PHONY: kind-deploy
kind-deploy: $(HELM) kind-load ## Build image, load it in kind cluster and deploy playground helm chart
Expand Down
11 changes: 11 additions & 0 deletions scripts/config/standard/kyverno-playground.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/rewrite-target: $1$2
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/playground)$ $1/ redirect;
hosts:
- host: ~
paths:
- path: /playground(/|$)(.*)
pathType: Prefix

0 comments on commit 3a5a8dd

Please sign in to comment.