diff --git a/Makefile b/Makefile index 77ea734fa..7336c7fe3 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ VERSION_MINOR:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 PATCH:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"' | awk -F. '{print $$NF}') SOURCE_DIRS = cmd pkg/apis pkg/controller pkg/server pkg/logging pkg/version run: - go run cmd/steerer/* -kubeconfig=$$HOME/.kube/config -log-level=debug -metrics-server=https://prometheus.istio.weavedx.com + go run cmd/steerer/* -kubeconfig=$$HOME/.kube/config -log-level=info -metrics-server=https://prometheus.istio.weavedx.com build: docker build -t stefanprodan/steerer:$(TAG) . -f Dockerfile @@ -25,8 +25,8 @@ test: test-fmt test-codegen go test ./... helm-package: - cd chart/ && helm package steerer/ - mv chart/*.tgz docs/ + cd charts/ && helm package steerer/ && helm package podinfo-steerer/ + mv charts/*.tgz docs/ helm repo index docs --url https://stefanprodan.github.io/steerer --merge ./docs/index.yaml helm-up: @@ -37,24 +37,25 @@ version-set: current="$(VERSION)" && \ sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \ sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \ - sed -i '' "s/tag: $$current/tag: $$next/g" chart/steerer/values.yaml && \ - sed -i '' "s/appVersion: $$current/appVersion: $$next/g" chart/steerer/Chart.yaml && \ - echo "Version $$next set in code, deployment and chart" + sed -i '' "s/tag: $$current/tag: $$next/g" charts/steerer/values.yaml && \ + sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \ + echo "Version $$next set in code, deployment and charts" version-up: @next="$(VERSION_MINOR).$$(($(PATCH) + 1))" && \ current="$(VERSION)" && \ sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \ sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \ - sed -i '' "s/tag: $$current/tag: $$next/g" chart/steerer/values.yaml && \ - sed -i '' "s/appVersion: $$current/appVersion: $$next/g" chart/steerer/Chart.yaml && \ + sed -i '' "s/tag: $$current/tag: $$next/g" charts/steerer/values.yaml && \ + sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \ echo "Version $$next set in code, deployment and chart" dev-up: version-up @echo "Starting build/push/deploy pipeline for $(VERSION)" docker build -t stefanprodan/steerer:$(VERSION) . -f Dockerfile docker push stefanprodan/steerer:$(VERSION) - helm upgrade --install steerer ./chart/steerer --namespace=istio-system + kubectl apply -f ./artifacts/steerer/crd.yaml + helm upgrade --install steerer ./charts/steerer --namespace=istio-system --set crd.create=false release: git tag $(VERSION) diff --git a/artifacts/rollouts/podinfoc.yaml b/artifacts/rollouts/podinfoc.yaml new file mode 100644 index 000000000..46c623111 --- /dev/null +++ b/artifacts/rollouts/podinfoc.yaml @@ -0,0 +1,36 @@ +apiVersion: apps.weave.works/v1beta1 +kind: Rollout +metadata: + name: podinfoc + namespace: test +spec: + targetKind: Deployment + virtualService: + name: podinfoc + primary: + name: podinfoc-primary + host: podinfoc-primary + canary: + name: podinfoc-canary + host: podinfoc-canary + canaryAnalysis: + # max number of failed metric checks + # before rolling back the canary + threshold: 10 + # max traffic percentage routed to canary + # percentage (0-100) + maxWeight: 50 + # canary increment step + # percentage (0-100) + stepWeight: 10 + metrics: + - name: istio_requests_total + # minimum req success rate (non 5xx responses) + # percentage (0-100) + threshold: 99 + interval: 1m + - name: istio_request_duration_seconds_bucket + # maximum req duration P99 + # milliseconds + threshold: 500 + interval: 30s diff --git a/charts/steerer/.helmignore b/charts/steerer/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/charts/steerer/.helmignore @@ -0,0 +1,21 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/chart/steerer/Chart.yaml b/charts/steerer/Chart.yaml similarity index 90% rename from chart/steerer/Chart.yaml rename to charts/steerer/Chart.yaml index d8baa4419..3fbaeb176 100644 --- a/chart/steerer/Chart.yaml +++ b/charts/steerer/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 name: steerer version: 0.0.1 -appVersion: 0.0.1-rc.6 +appVersion: 0.0.1-rc.16 description: Steerer is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis. diff --git a/chart/steerer/README.md b/charts/steerer/README.md similarity index 100% rename from chart/steerer/README.md rename to charts/steerer/README.md diff --git a/chart/steerer/templates/NOTES.txt b/charts/steerer/templates/NOTES.txt similarity index 100% rename from chart/steerer/templates/NOTES.txt rename to charts/steerer/templates/NOTES.txt diff --git a/chart/steerer/templates/_helpers.tpl b/charts/steerer/templates/_helpers.tpl similarity index 100% rename from chart/steerer/templates/_helpers.tpl rename to charts/steerer/templates/_helpers.tpl diff --git a/chart/steerer/templates/account.yaml b/charts/steerer/templates/account.yaml similarity index 100% rename from chart/steerer/templates/account.yaml rename to charts/steerer/templates/account.yaml diff --git a/chart/steerer/templates/crd.yaml b/charts/steerer/templates/crd.yaml similarity index 100% rename from chart/steerer/templates/crd.yaml rename to charts/steerer/templates/crd.yaml diff --git a/chart/steerer/templates/deployment.yaml b/charts/steerer/templates/deployment.yaml similarity index 100% rename from chart/steerer/templates/deployment.yaml rename to charts/steerer/templates/deployment.yaml diff --git a/chart/steerer/templates/rbac.yaml b/charts/steerer/templates/rbac.yaml similarity index 100% rename from chart/steerer/templates/rbac.yaml rename to charts/steerer/templates/rbac.yaml diff --git a/chart/steerer/values.yaml b/charts/steerer/values.yaml similarity index 95% rename from chart/steerer/values.yaml rename to charts/steerer/values.yaml index e41546728..316cf44e2 100644 --- a/chart/steerer/values.yaml +++ b/charts/steerer/values.yaml @@ -2,7 +2,7 @@ image: repository: stefanprodan/steerer - tag: 0.0.1-rc.6 + tag: 0.0.1-rc.16 pullPolicy: IfNotPresent controlLoopInterval: "10s" diff --git a/docs/podinfo-steerer-1.2.1.tgz b/docs/podinfo-steerer-1.2.1.tgz new file mode 100644 index 000000000..aee90876b Binary files /dev/null and b/docs/podinfo-steerer-1.2.1.tgz differ