-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch from dep to go modules * upgrade dependencies * simplify a bit the example and its instructions * add containersol/helm-monitor Docker container
- Loading branch information
1 parent
1d72a7b
commit 4df71fb
Showing
26 changed files
with
467 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.DS_Store | ||
.git | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
LICENSE | ||
Makefile | ||
README.md | ||
asciinema_demo.json | ||
examples | ||
helm-monitor-diagram.jpg | ||
helm-monitor-failure.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
vendor | ||
examples/app/vendor | ||
_dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
language: go | ||
|
||
go: | ||
- 1.9.2 | ||
|
||
install: | ||
- make dep | ||
- master | ||
|
||
script: | ||
- make test-all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM golang:1.11 AS build | ||
ENV GOPATH="" | ||
ENV GO111MODULE=on | ||
ARG LDFLAGS | ||
COPY . /go | ||
RUN go build -o helm-monitor -ldflags "$LDFLAGS" ./cmd/... | ||
|
||
FROM alpine AS helm | ||
ENV HELM_VERSION=v2.10.0 | ||
ENV HELM_TMP_FILE=helm-${HELM_VERSION}-linux-amd64.tar.gz | ||
RUN wget https://storage.googleapis.com/kubernetes-helm/${HELM_TMP_FILE} && \ | ||
wget https://storage.googleapis.com/kubernetes-helm/${HELM_TMP_FILE}.sha256 | ||
RUN apk --no-cache add openssl | ||
RUN if [ "$(openssl sha1 -sha256 ${HELM_TMP_FILE} | awk '{print $2}')" != "$(cat helm-${HELM_VERSION}-linux-amd64.tar.gz.sha256)" ]; \ | ||
then \ | ||
echo "SHA sum of ${HELM_TMP_FILE} does not match. Aborting."; \ | ||
exit 1; \ | ||
fi | ||
RUN tar -xvf helm-${HELM_VERSION}-linux-amd64.tar.gz | ||
|
||
FROM alpine:3.8 | ||
COPY --from=helm /linux-amd64/helm /usr/local/bin/helm | ||
RUN helm init --skip-refresh --client-only && \ | ||
mkdir -p /root/.helm/plugins/helm-monitor | ||
COPY plugin.yaml /root/.helm/plugins/helm-monitor/plugin.yaml | ||
COPY --from=build /go/helm-monitor /root/.helm/plugins/helm-monitor/helm-monitor | ||
ENTRYPOINT ["helm"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
.PHONY: installtiller | ||
installtiller: | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.9/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml --validate=false | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.9/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-role-bindings.yaml --validate=false | ||
kubectl create serviceaccount tiller --namespace kube-system || true | ||
kubectl create clusterrolebinding tiller \ | ||
--clusterrole=cluster-admin \ | ||
--serviceaccount=kube-system:tiller || true | ||
helm init --upgrade --service-account tiller | ||
PROMETHEUS_VERSION=7.0.2 | ||
|
||
.PHONY: prepare | ||
prepare: | ||
.PHONY: build | ||
build: | ||
eval $$(minikube docker-env) && \ | ||
docker build --build-arg "VERSION=1.0.0" -t app:1.0.0 app && \ | ||
docker build --build-arg "VERSION=2.0.0" -t app:2.0.0 app | ||
docker build \ | ||
-v $${HOME}/go:/root/go \ | ||
--build-arg "LDFLAGS=-X main.version=1.0.0" \ | ||
-t my-app:1.0.0 \ | ||
app && \ | ||
docker build \ | ||
-v $${HOME}/go:/root/go \ | ||
--build-arg "LDFLAGS=-X main.version=2.0.0" \ | ||
-t my-app:2.0.0 \ | ||
app | ||
|
||
.PHONY: deployv1 | ||
deployv1: | ||
helm upgrade --install my-release ./app/charts --set image.tag=1.0.0 | ||
helm upgrade -i my-app --set image.tag=1.0.0 ./app/charts | ||
|
||
.PHONY: deployv2 | ||
deployv2: | ||
helm upgrade my-release ./app/charts --set image.tag=2.0.0 | ||
helm upgrade -i my-app --set image.tag=2.0.0 ./app/charts | ||
|
||
.PHONY: installprometheus | ||
installprometheus: | ||
helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/ | ||
helm upgrade --install prometheus-operator coreos/prometheus-operator | ||
kubectl apply -f ./prometheus.yaml | ||
helm upgrade -i \ | ||
--version $(PROMETHEUS_VERSION) \ | ||
--set server.service.type=LoadBalancer \ | ||
--set server.global.scrape_interval=30s \ | ||
--set alertmanager.enabled=false \ | ||
--set kubeStateMetrics.enabled=false \ | ||
--set nodeExporter.enabled=false \ | ||
--set pushgateway.enabled=false \ | ||
prometheus \ | ||
stable/prometheus | ||
|
||
.PHONY: cleanup | ||
kubectl delete -f ./prometheus.yaml | ||
helm del --purge prometheus-operator my-release | ||
helm del --purge prometheus my-app |
Oops, something went wrong.