Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving agent helm chart to dependency #5328

Merged
merged 9 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ runs:
- name: "Install Python requirements with pip"
shell: bash
run: python -m pip install awscli packaging

# Helm Deps
- name: "Install Helm Dependencies"
shell: bash
run: |
helm repo add agent https://s3.amazonaws.com/datawire-static-files/charts
helm repo update
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ $(call module,ambassador,$(OSS_HOME))
include $(OSS_HOME)/build-aux/generate.mk
include $(OSS_HOME)/build-aux/lint.mk

HELM_TEST_IMAGE = quay.io/helmpack/chart-testing:v3.0.0-rc.1
CHART_DIR := $(OSS_HOME)/build-output/chart-$(patsubst v%,%,$(VERSION))_$(patsubst v%,%,$(CHART_VERSION)).d
CT_EXEC = docker run --rm -v $(KIND_KUBECONFIG):/root/.kube/config -v $(CHART_DIR) --network host $(HELM_TEST_IMAGE) $(CHART_DIR)/ci.in/ct.sh

chart/lint: preflight-dev-kubeconfig
$(CT_EXEC) lint --config /ct.yaml
.PHONY: chart/lint

chart/k3d-test: preflight-dev-kubeconfig
# check if k3d is installed
@if ! command -v k3d 2> /dev/null ; then \
printf 'k3d not installed, please do that'; \
false; \
fi
.PHONY: chart/k3d-test

chart/test: chart/lint chart/k3d-test ci/setup-k3d
$(CT_EXEC) install --config /ct.yaml && \
$(MAKE) chart/delete-cluster
.PHONY: chart/test

.git/hooks/prepare-commit-msg:
ln -s $(OSS_HOME)/tools/hooks/prepare-commit-msg $(OSS_HOME)/.git/hooks/prepare-commit-msg

Expand All @@ -90,9 +111,10 @@ deploy: push preflight-cluster
$(MAKE) deploy-only
.PHONY: deploy

deploy-only: preflight-dev-kubeconfig $(tools/kubectl) build-output/yaml-$(patsubst v%,%,$(VERSION)) $(boguschart_dir)
deploy-only: preflight-dev-kubeconfig chart/test $(tools/kubectl) build-output/yaml-$(patsubst v%,%,$(VERSION)) $(boguschart_dir)
mkdir -p $(OSS_HOME)/build/helm/ && \
($(tools/kubectl) --kubeconfig $(DEV_KUBECONFIG) create ns ambassador || true) && \
helm dependency build && \
helm template ambassador --output-dir $(OSS_HOME)/build/helm -n ambassador $(boguschart_dir) \
--set createNamespace=true \
--set service.selector.service=ambassador \
Expand Down
6 changes: 5 additions & 1 deletion build-aux/generate.mk
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ helm.namespace.emissary-defaultns-migration = default

# IF YOU'RE LOOKING FOR *.yaml: recipes, look in main.mk.

$(OSS_HOME)/k8s-config/%/helm-expanded.yaml: \
helm-dependency: $(boguschart_dir)
cd $(boguschart_dir) && helm dependency build
.PHONY: helm-dependency

$(OSS_HOME)/k8s-config/%/helm-expanded.yaml: helm-dependency \
$(OSS_HOME)/k8s-config/%/values.yaml \
$(boguschart_dir)
helm template --namespace=$(helm.namespace.$*) --values=$(@D)/values.yaml $(or $(helm.name.$*),$*) $(boguschart_dir) >$@
Expand Down
1 change: 1 addition & 0 deletions build-aux/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ endif
}
$(tools/chart-doc-gen) -d $</doc.yaml -t $</readme.tpl -v $@/values.yaml >$@/README.md
build-output/chart-%.tgz: build-output/chart-%.d
cd $< && helm dependency build
helm package --destination=$< $<
mv $</emissary-ingress-$(word 2,$(subst _, ,$*)).tgz $@

Expand Down
6 changes: 6 additions & 0 deletions charts/emissary-ingress/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: ambassador-agent
repository: https://s3.amazonaws.com/datawire-static-files/charts
version: 1.0.18
digest: sha256:e3e849f13219638d9f10874165c6026bea1598cb487b77cc309cb60d82fed00b
generated: "2023-11-03T12:55:18.614119-04:00"
27 changes: 17 additions & 10 deletions charts/emissary-ingress/Chart.yaml.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
appVersion: @version@
description: A Helm chart for Emissary Ingress
name: emissary-ingress
Expand All @@ -16,12 +16,19 @@ keywords:
- emissary
- emissary ingress
maintainers:
- name: flydiverny
email: [email protected]
- name: kflynn
email: [email protected]
- name: nbkrause
email: [email protected]
- name: lukeshu
email: [email protected]
engine: gotpl
- name: Alice Wasko
email: [email protected]
- name: Hamzah Qudsi
email: [email protected]
- name: Lance Austin
email: [email protected]
- name: Rick Lane
email: [email protected]
- name: Tenshin Higashi
email: [email protected]
dependencies:
- name: ambassador-agent
version: 1.0.18
repository: https://s3.amazonaws.com/datawire-static-files/charts
condition: agent.enabled
alias: agent
7 changes: 7 additions & 0 deletions charts/emissary-ingress/ci.in/ct.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -ex

helm repo add ambassador-agent https://s3.amazonaws.com/datawire-static-files/charts || helm repo update

ct "$@"
3 changes: 3 additions & 0 deletions charts/emissary-ingress/ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ charts:
- ./
chart-dirs:
- ./
chart-repos:
- datawire=https://s3.amazonaws.com/datawire-static-files/charts/
- datawiredev=https://s3.amazonaws.com/datawire-static-files/charts-dev/


# namespace: ambassador
Expand Down
Loading
Loading