Skip to content

Commit

Permalink
helm: add envoy gateway addon helm chart support (envoyproxy#3470)
Browse files Browse the repository at this point in the history
* initial dashboard addon helm chart

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

* rename addon name and remove gateway-helm support

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

* remove /charts from .helmignore

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

* rename to gateway-addons-helm and keep one source of truth

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

* restore examples values and fix comments

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

* rewrite helm makefile

Signed-off-by: shawnh2 <shawnhxh@outlook.com>

---------

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
  • Loading branch information
shawnh2 authored Jun 4, 2024
1 parent 09fd519 commit 607d8bc
Show file tree
Hide file tree
Showing 12 changed files with 181 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ vendor/
# values.yaml file is generated from its template counterpart.
charts/gateway-helm/values.yaml

# dependency charts generated by addons helm.
charts/gateway-addons-helm/charts/

# VIM
.*.swp
23 changes: 23 additions & 0 deletions charts/gateway-addons-helm/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
9 changes: 9 additions & 0 deletions charts/gateway-addons-helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 23.1.0
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.58.4
digest: sha256:d4ffdf4c4b286fd4fdebf553d4d48cf2654c8df431d75d7c22c0bfabfe1c6b15
generated: "2024-06-02T11:28:44.08768+08:00"
33 changes: 33 additions & 0 deletions charts/gateway-addons-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v2
name: gateway-addons-helm
description: An Add-ons Helm chart for Envoy Gateway
type: application

version: v0.0.0-latest
appVersion: "latest"
icon: https://raw.githubusercontent.com/envoyproxy/gateway/main/site/assets/icons/logo.svg

maintainers:
- name: envoy-gateway-steering-committee
url: https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md
- name: envoy-gateway-maintainers
url: https://github.com/envoyproxy/gateway/blob/main/CODEOWNERS

keywords:
- gateway-api
- envoyproxy
- envoy-gateway
- eg

home: https://gateway.envoyproxy.io/

sources:
- https://github.com/envoyproxy/gateway

dependencies:
- name: prometheus
version: 23.1.0
repository: https://prometheus-community.github.io/helm-charts
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.58.4
20 changes: 20 additions & 0 deletions charts/gateway-addons-helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**************************************************************************
*** PLEASE BE PATIENT: Envoy Gateway may take a few minutes to install ***
**************************************************************************

Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway.

Thank you for installing the Add-ons for Envoy Gateway! 🎉

Your release is named: {{ .Release.Name }}. 🎉

Your release is in namespace: {{ .Release.Namespace }}. 🎉

To learn more about the release, try:

$ helm status {{ .Release.Name }} -n {{ .Release.Namespace }}
$ helm get all {{ .Release.Name }} -n {{ .Release.Namespace }}

To have a quickstart of the Add-ons for Envoy Gateway, please refer to https://gateway.envoyproxy.io/latest/tasks/observability/.

To get more details, please visit https://gateway.envoyproxy.io and https://github.com/envoyproxy/gateway.
39 changes: 39 additions & 0 deletions charts/gateway-addons-helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Values for Grafana dependency
grafana:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server
adminPassword: admin
service:
type: LoadBalancer

# Values for Prometheus dependency
prometheus:
# To simplify the deployment, disable non-essential components
alertmanager:
enabled: false
prometheus-pushgateway:
enabled: false
kube-state-metrics:
enabled: false
prometheus-node-exporter:
enabled: false
server:
fullnameOverride: prometheus
persistentVolume:
enabled: false
readinessProbeInitialDelay: 0
global:
# Speed up scraping a bit from the default
scrape_interval: 15s
service:
# use LoadBalancer to expose prometheus
type: LoadBalancer
# use dockerhub
image:
repository: prom/prometheus
securityContext: null
1 change: 0 additions & 1 deletion examples/prometheus/helm-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ server:
image:
repository: prom/prometheus
securityContext: null

66 changes: 54 additions & 12 deletions tools/make/helm.mk
Original file line number Diff line number Diff line change
@@ -1,35 +1,77 @@
# This is a wrapper to manage helm chart
#
# All make targets related to helmß are defined in this file.
# All make targets related to helms are defined in this file.

include tools/make/env.mk

CHARTS := $(wildcard charts/*)

IMAGE_PULL_POLICY ?= IfNotPresent
OCI_REGISTRY ?= oci://docker.io/envoyproxy
CHART_NAME ?= gateway-helm
CHART_VERSION ?= ${RELEASE_VERSION}
RELEASE_NAMESPACE ?= envoy-gateway-system

##@ Helm
.PHONY: helm-package
helm-package: ## Package envoy gateway relevant helm charts.
helm-package:
helm-package: ## Package envoy gateway helm chart.
helm-package: helm-generate
@$(LOG_TARGET)
@for chart in $(CHARTS); do \
$(LOG_TARGET); \
$(MAKE) $(addprefix helm-package., $$(basename $${chart})); \
done

.PHONY: helm-package.%
helm-package.%: helm-generate.%
$(eval COMMAND := $(word 1,$(subst ., ,$*)))
$(eval CHART_NAME := $(COMMAND))
helm package charts/${CHART_NAME} --app-version ${TAG} --version ${CHART_VERSION} --destination ${OUTPUT_DIR}/charts/

.PHONY: helm-push
helm-push: ## Push envoy gateway relevant helm charts to OCI registry.
helm-push:
helm-push: ## Push envoy gateway helm chart to OCI registry.
@$(LOG_TARGET)
@for chart in $(CHARTS); do \
$(LOG_TARGET); \
$(MAKE) $(addprefix helm-push., $$(basename $${chart})); \
done

.PHONY: helm-push.%
helm-push.%: helm-package.%
$(eval COMMAND := $(word 1,$(subst ., ,$*)))
$(eval CHART_NAME := $(COMMAND))
helm push ${OUTPUT_DIR}/charts/${CHART_NAME}-${CHART_VERSION}.tgz ${OCI_REGISTRY}

.PHONY: helm-install
helm-install: ## Install envoy gateway relevant helm charts from OCI registry.
helm-install:
helm-install: helm-generate ## Install envoy gateway helm chart from OCI registry.
@$(LOG_TARGET)
helm install eg ${OCI_REGISTRY}/${CHART_NAME} --version ${CHART_VERSION} -n envoy-gateway-system --create-namespace
@for chart in $(CHARTS); do \
$(LOG_TARGET); \
$(MAKE) $(addprefix helm-install., $$(basename $${chart})); \
done

.PHONY: helm-install.%
helm-install.%: helm-generate.%
$(eval COMMAND := $(word 1,$(subst ., ,$*)))
$(eval CHART_NAME := $(COMMAND))
helm install eg ${OCI_REGISTRY}/${CHART_NAME} --version ${CHART_VERSION} -n ${RELEASE_NAMESPACE} --create-namespace

.PHONY: helm-generate
helm-generate:
GatewayImage=${IMAGE}:${TAG} GatewayImagePullPolicy=${IMAGE_PULL_POLICY} envsubst < charts/gateway-helm/values.tmpl.yaml > ./charts/gateway-helm/values.yaml
helm lint charts/gateway-helm
@for chart in $(CHARTS); do \
$(LOG_TARGET); \
$(MAKE) $(addprefix helm-generate., $$(basename $${chart})); \
done

.PHONY: helm-generate.%
helm-generate.%:
$(eval COMMAND := $(word 1,$(subst ., ,$*)))
$(eval CHART_NAME := $(COMMAND))
@if test -f "charts/${CHART_NAME}/values.tmpl.yaml"; then \
GatewayImage=${IMAGE}:${TAG} GatewayImagePullPolicy=${IMAGE_PULL_POLICY} \
envsubst < charts/${CHART_NAME}/values.tmpl.yaml > ./charts/${CHART_NAME}/values.yaml; \
fi
helm lint charts/${CHART_NAME}
helm dependency update charts/${CHART_NAME} # Update dependencies for add-ons chart.

HELM_VALUES := $(wildcard test/helm/*.in.yaml)

Expand All @@ -38,5 +80,5 @@ helm-template: ## Template envoy gateway helm chart.z
@for file in $(HELM_VALUES); do \
filename=$$(basename $${file}); \
output="$${filename%.in.*}.out.yaml"; \
helm template eg charts/gateway-helm -f $${file} > test/helm/$$output --namespace=envoy-gateway-system; \
helm template eg charts/${CHART_NAME} -f $${file} > test/helm/$$output --namespace=${RELEASE_NAMESPACE}; \
done

0 comments on commit 607d8bc

Please sign in to comment.