Switch to Helm 3-alpha1 (#453)

This commit is contained in:
Jeremy Edwards
2019-05-30 16:03:28 -07:00
committed by GitHub
parent de8279dfe0
commit 2ef8614687
5 changed files with 44 additions and 63 deletions

View File

@ -57,7 +57,7 @@ YEAR_MONTH = $(shell date -u +'%Y%m')
MAJOR_MINOR_VERSION = $(shell echo $(BASE_VERSION) | cut -d '.' -f1).$(shell echo $(BASE_VERSION) | cut -d '.' -f2)
PROTOC_VERSION = 3.7.1
HELM_VERSION = 2.14.0
HELM_VERSION = 3.0.0-alpha.1
HUGO_VERSION = 0.55.5
KUBECTL_VERSION = 1.14.2
NODEJS_VERSION = 10.15.3
@ -139,7 +139,7 @@ endif
ifeq ($(OS),Windows_NT)
# TODO: Windows packages are here but things are broken since many paths are Linux based and zip vs tar.gz.
HELM_PACKAGE = https://storage.googleapis.com/kubernetes-helm/helm-v$(HELM_VERSION)-windows-amd64.zip
HELM_PACKAGE = https://get.helm.sh/helm-v$(HELM_VERSION)-windows-amd64.zip
MINIKUBE_PACKAGE = https://storage.googleapis.com/minikube/releases/$(MINIKUBE_VERSION)/minikube-windows-amd64.exe
SKAFFOLD_PACKAGE = https://storage.googleapis.com/skaffold/releases/$(SKAFFOLD_VERSION)/skaffold-windows-amd64.exe
EXE_EXTENSION = .exe
@ -154,7 +154,7 @@ ifeq ($(OS),Windows_NT)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
HELM_PACKAGE = https://storage.googleapis.com/kubernetes-helm/helm-v$(HELM_VERSION)-linux-amd64.tar.gz
HELM_PACKAGE = https://get.helm.sh/helm-v$(HELM_VERSION)-linux-amd64.tar.gz
MINIKUBE_PACKAGE = https://storage.googleapis.com/minikube/releases/$(MINIKUBE_VERSION)/minikube-linux-amd64
SKAFFOLD_PACKAGE = https://storage.googleapis.com/skaffold/releases/$(SKAFFOLD_VERSION)/skaffold-linux-amd64
PROTOC_PACKAGE = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-linux-x86_64.zip
@ -167,7 +167,7 @@ else
KIND_PACKAGE = https://github.com/kubernetes-sigs/kind/releases/download/$(KIND_VERSION)/kind-linux-amd64
endif
ifeq ($(UNAME_S),Darwin)
HELM_PACKAGE = https://storage.googleapis.com/kubernetes-helm/helm-v$(HELM_VERSION)-darwin-amd64.tar.gz
HELM_PACKAGE = https://get.helm.sh/helm-v$(HELM_VERSION)-darwin-amd64.tar.gz
MINIKUBE_PACKAGE = https://storage.googleapis.com/minikube/releases/$(MINIKUBE_VERSION)/minikube-darwin-amd64
SKAFFOLD_PACKAGE = https://storage.googleapis.com/skaffold/releases/$(SKAFFOLD_VERSION)/skaffold-darwin-amd64
PROTOC_PACKAGE = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-osx-x86_64.zip
@ -265,14 +265,16 @@ update-chart-deps: build/toolchain/bin/helm$(EXE_EXTENSION)
(cd install/helm/open-match; $(HELM) repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com; $(HELM) dependency update)
lint-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
(cd install/helm; $(HELM) lint open-match; $(HELM) lint open-match-example)
(cd install/helm; $(HELM) lint $(OPEN_MATCH_CHART_NAME); $(HELM) lint $(OPEN_MATCH_EXAMPLE_CHART_NAME))
print-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
(cd install/helm; $(HELM) install --dry-run --debug open-match; $(HELM) install --dry-run --debug open-match-example)
(cd install/helm; $(HELM) install $(OPEN_MATCH_CHART_NAME) --dry-run --debug $(OPEN_MATCH_CHART_NAME); $(HELM) install $(OPEN_MATCH_EXAMPLE_CHART_NAME) --dry-run --debug $(OPEN_MATCH_EXAMPLE_CHART_NAME))
install-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
$(HELM) upgrade --install --wait --debug $(OPEN_MATCH_CHART_NAME) install/helm/open-match \
--timeout=400 \
# https://github.com/helm/helm/issues/5814
# --wait isn't implemented yet.
$(HELM) upgrade $(OPEN_MATCH_CHART_NAME) --install --wait --debug install/helm/open-match \
--timeout=10m \
--namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG) \
@ -284,7 +286,7 @@ install-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
--set openmatch.monitoring.stackdriver.gcpProjectId=$(GCP_PROJECT_ID)
install-example-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
$(HELM) upgrade --install --wait --debug $(OPEN_MATCH_EXAMPLE_CHART_NAME) install/helm/open-match-example \
$(HELM) upgrade $(OPEN_MATCH_EXAMPLE_CHART_NAME) --install --wait --debug $(OPEN_MATCH_EXAMPLE_CHART_NAME) install/helm/open-match-example \
--namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG)
@ -293,13 +295,13 @@ delete-example-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
-$(HELM) delete --purge $(OPEN_MATCH_EXAMPLE_CHART_NAME)
dry-chart: build/toolchain/bin/helm$(EXE_EXTENSION)
$(HELM) upgrade --install --wait --debug --dry-run $(OPEN_MATCH_CHART_NAME) install/helm/open-match \
$(HELM) upgrade $(OPEN_MATCH_CHART_NAME) --install --wait --debug --dry-run install/helm/open-match \
--namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG)
delete-chart: build/toolchain/bin/helm$(EXE_EXTENSION) build/toolchain/bin/kubectl$(EXE_EXTENSION)
-$(HELM) delete --purge $(OPEN_MATCH_CHART_NAME)
-$(HELM) delete $(OPEN_MATCH_CHART_NAME)
-$(KUBECTL) --ignore-not-found=true delete crd prometheuses.monitoring.coreos.com
-$(KUBECTL) --ignore-not-found=true delete crd servicemonitors.monitoring.coreos.com
-$(KUBECTL) --ignore-not-found=true delete crd prometheusrules.monitoring.coreos.com
@ -308,7 +310,7 @@ install/yaml/: install/yaml/install.yaml install/yaml/install-example.yaml insta
install/yaml/01-redis-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set redis.fullnameOverride='$(REDIS_NAME)' \
--set openmatch.config.install=false \
--set openmatch.backend.install=false \
@ -323,7 +325,7 @@ install/yaml/01-redis-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/02-open-match.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set redis.fullnameOverride='$(REDIS_NAME)' \
--set redis.enabled=false \
--set prometheus.enabled=false \
@ -335,7 +337,7 @@ install/yaml/02-open-match.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/03-prometheus-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set redis.enabled=false \
--set openmatch.config.install=false \
--set openmatch.backend.install=false \
@ -350,7 +352,7 @@ install/yaml/03-prometheus-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/04-grafana-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set redis.enabled=false \
--set openmatch.config.install=false \
--set openmatch.backend.install=false \
@ -365,7 +367,7 @@ install/yaml/04-grafana-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/05-jaeger-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set redis.fullnameOverride='$(REDIS_NAME)' \
--set openmatch.config.install=false \
--set openmatch.backend.install=false \
@ -379,7 +381,7 @@ install/yaml/05-jaeger-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/install.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_CHART_NAME) --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG) \
--set redis.enabled=true \
@ -390,7 +392,7 @@ install/yaml/install.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
install/yaml/install-example.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template --name $(OPEN_MATCH_EXAMPLE_CHART_NAME) --namespace $(OPEN_MATCH_EXAMPLE_KUBERNETES_NAMESPACE) \
$(HELM) template $(OPEN_MATCH_EXAMPLE_CHART_NAME) --namespace $(OPEN_MATCH_EXAMPLE_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG) \
install/helm/open-match-example > install/yaml/install-example.yaml
@ -418,7 +420,6 @@ else
cd $(TOOLCHAIN_DIR)/temp-helm && curl -Lo helm.tar.gz $(HELM_PACKAGE) && tar xzf helm.tar.gz --strip-components 1
endif
mv $(TOOLCHAIN_DIR)/temp-helm/helm$(EXE_EXTENSION) $(TOOLCHAIN_BIN)/helm$(EXE_EXTENSION)
mv $(TOOLCHAIN_DIR)/temp-helm/tiller$(EXE_EXTENSION) $(TOOLCHAIN_BIN)/tiller$(EXE_EXTENSION)
rm -rf $(TOOLCHAIN_DIR)/temp-helm/
build/toolchain/bin/hugo$(EXE_EXTENSION):
@ -539,15 +540,8 @@ build/toolchain/bin/certgen$(EXE_EXTENSION): tools/certgen/certgen$(EXE_EXTENSIO
mkdir -p $(TOOLCHAIN_BIN)
cp -f $(REPOSITORY_ROOT)/tools/certgen/certgen$(EXE_EXTENSION) $(TOOLCHAIN_BIN)/certgen$(EXE_EXTENSION)
push-helm: build/toolchain/bin/helm$(EXE_EXTENSION) build/toolchain/bin/kubectl$(EXE_EXTENSION)
$(KUBECTL) create serviceaccount --namespace kube-system tiller
$(HELM) init --service-account tiller --force-upgrade
$(KUBECTL) create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
ifneq ($(strip $($(KUBECTL) get clusterroles | grep -i rbac)),)
$(KUBECTL) patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
endif
@echo "Waiting for Tiller to become ready..."
$(KUBECTL) wait deployment --timeout=60s --for condition=available -l app=helm,name=tiller --namespace kube-system
push-helm: build/toolchain/bin/helm$(EXE_EXTENSION)
$(HELM) init
delete-helm: build/toolchain/bin/helm$(EXE_EXTENSION) build/toolchain/bin/kubectl$(EXE_EXTENSION)
-$(HELM) reset

View File

@ -11,5 +11,5 @@ dependencies:
- name: jaeger
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
version: 0.10.2
digest: sha256:3c5f199dca3f5e9025a41a39999768fc4bfeb3a6345575e6b003b212feacc590
generated: 2019-05-07T11:10:58.983105838-07:00
digest: sha256:173085826cf82f6f607ce460197dcb68b6db4fc9806e8634689f707de059bf19
generated: "2019-05-29T09:49:39.401587679-07:00"

View File

@ -34,3 +34,23 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/GoogleCloudPlatform/open-match/master/site/static/images/logo.svg
tillerVersion: ">2.10.0"
# TIP: Find versions via `gsutil ls gs://kubernetes-charts`
dependencies:
- name: prometheus
version: 8.10.3
repository: https://kubernetes-charts.storage.googleapis.com/
condition: prometheus.enabled
- name: redis
version: 7.1.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: redis.enabled
- name: grafana
version: 3.3.6
repository: https://kubernetes-charts.storage.googleapis.com/
condition: grafana.enabled
- name: jaeger
version: 0.10.2
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
condition: jaeger.enabled

View File

@ -1,33 +0,0 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TIP: Find versions via `gsutil ls gs://kubernetes-charts`
dependencies:
- name: prometheus
version: 8.10.3
repository: https://kubernetes-charts.storage.googleapis.com/
condition: prometheus.enabled
- name: redis
version: 7.1.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: redis.enabled
- name: grafana
version: 3.3.6
repository: https://kubernetes-charts.storage.googleapis.com/
condition: grafana.enabled
- name: jaeger
version: 0.10.2
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
condition: jaeger.enabled