Skip to content

Commit

Permalink
Add podinfo chart for GitOps testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Oct 1, 2018
1 parent 3938eb6 commit 3a05cfa
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 11 deletions.
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
Expand Down
36 changes: 36 additions & 0 deletions artifacts/rollouts/podinfoc.yaml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions charts/steerer/.helmignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion chart/steerer/Chart.yaml → charts/steerer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion chart/steerer/values.yaml → charts/steerer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

image:
repository: stefanprodan/steerer
tag: 0.0.1-rc.6
tag: 0.0.1-rc.16
pullPolicy: IfNotPresent

controlLoopInterval: "10s"
Expand Down
Binary file added docs/podinfo-steerer-1.2.1.tgz
Binary file not shown.

0 comments on commit 3a05cfa

Please sign in to comment.