Rename project to flagger

This commit is contained in:
Stefan Prodan
2018-10-07 13:08:42 +03:00
parent 0848fb27d2
commit c3f4f0a925
90 changed files with 482 additions and 501 deletions

View File

@@ -1,7 +1,7 @@
builds:
- main: ./cmd/steerer
binary: steerer
ldflags: -s -w -X github.com/stefanprodan/steerer/pkg/version.REVISION={{.Commit}}
- main: ./cmd/flagger
binary: flagger
ldflags: -s -w -X github.com/stefanprodan/flagger/pkg/version.REVISION={{.Commit}}
goos:
- linux
goarch:

View File

@@ -21,17 +21,17 @@ after_success:
- if [ -z "$DOCKER_USER" ]; then
echo "PR build, skipping Docker Hub push";
else
docker tag stefanprodan/steerer:latest stefanprodan/steerer:${TRAVIS_COMMIT};
docker tag stefanprodan/flagger:latest stefanprodan/flagger:${TRAVIS_COMMIT};
echo $DOCKER_PASS | docker login -u=$DOCKER_USER --password-stdin;
docker push stefanprodan/steerer:${TRAVIS_COMMIT};
docker push stefanprodan/flagger:${TRAVIS_COMMIT};
fi
- if [ -z "$TRAVIS_TAG" ]; then
echo "Not a release, skipping Docker Hub push";
else
docker tag stefanprodan/steerer:latest stefanprodan/steerer:$TRAVIS_TAG;
docker tag stefanprodan/flagger:latest stefanprodan/flagger:$TRAVIS_TAG;
echo $DOCKER_PASS | docker login -u=$DOCKER_USER --password-stdin;
docker push stefanprodan/steerer:latest;
docker push stefanprodan/steerer:$TRAVIS_TAG;
docker push stefanprodan/flagger:latest;
docker push stefanprodan/flagger:$TRAVIS_TAG;
fi
deploy:

View File

@@ -1,15 +1,15 @@
FROM golang:1.10
RUN mkdir -p /go/src/github.com/stefanprodan/steerer/
RUN mkdir -p /go/src/github.com/stefanprodan/flagger/
WORKDIR /go/src/github.com/stefanprodan/steerer
WORKDIR /go/src/github.com/stefanprodan/flagger
COPY . .
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/steerer/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o steerer ./cmd/steerer/*
-X github.com/stefanprodan/flagger/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o flagger ./cmd/flagger/*
FROM alpine:3.8
@@ -19,11 +19,11 @@ RUN addgroup -S app \
WORKDIR /home/app
COPY --from=0 /go/src/github.com/stefanprodan/steerer/steerer .
COPY --from=0 /go/src/github.com/stefanprodan/flagger/flagger .
RUN chown -R app:app ./
USER app
ENTRYPOINT ["./steerer"]
ENTRYPOINT ["./flagger"]

View File

@@ -4,13 +4,13 @@ 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=info -metrics-server=https://prometheus.istio.weavedx.com
go run cmd/flagger/* -kubeconfig=$$HOME/.kube/config -log-level=info -metrics-server=https://prometheus.istio.weavedx.com
build:
docker build -t stefanprodan/steerer:$(TAG) . -f Dockerfile
docker build -t stefanprodan/flagger:$(TAG) . -f Dockerfile
push:
docker push stefanprodan/steerer:$(TAG)
docker push stefanprodan/flagger:$(TAG)
fmt:
gofmt -l -s -w $(SOURCE_DIRS)
@@ -25,37 +25,37 @@ test: test-fmt test-codegen
go test ./...
helm-package:
cd charts/ && helm package steerer/ && helm package podinfo-steerer/ && helm package grafana/
cd charts/ && helm package flagger/ && helm package podinfo-flagger/ && helm package grafana/
mv charts/*.tgz docs/
helm repo index docs --url https://stefanprodan.github.io/steerer --merge ./docs/index.yaml
helm repo index docs --url https://stefanprodan.github.io/flagger --merge ./docs/index.yaml
helm-up:
helm upgrade --install steerer ./chart/steerer --namespace=istio-system
helm upgrade --install flagger ./charts/flagger --namespace=istio-system --set crd.create=false
version-set:
@next="$(TAG)" && \
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" charts/steerer/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \
sed -i '' "s/flagger:$$current/flagger:$$next/g" artifacts/flagger/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/flagger/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/flagger/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" charts/steerer/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/steerer/Chart.yaml && \
sed -i '' "s/flagger:$$current/flagger:$$next/g" artifacts/flagger/deployment.yaml && \
sed -i '' "s/tag: $$current/tag: $$next/g" charts/flagger/values.yaml && \
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/flagger/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)
kubectl apply -f ./artifacts/steerer/crd.yaml
helm upgrade --install steerer ./charts/steerer --namespace=istio-system --set crd.create=false
docker build -t stefanprodan/flagger:$(VERSION) . -f Dockerfile
docker push stefanprodan/flagger:$(VERSION)
kubectl apply -f ./artifacts/flagger/crd.yaml
helm upgrade --install flagger ./charts/flagger --namespace=istio-system --set crd.create=false
release:
git tag $(VERSION)

152
README.md
View File

@@ -1,43 +1,43 @@
# steerer
# flagger
[![build](https://travis-ci.org/stefanprodan/steerer.svg?branch=master)](https://travis-ci.org/stefanprodan/steerer)
[![report](https://goreportcard.com/badge/github.com/stefanprodan/steerer)](https://goreportcard.com/report/github.com/stefanprodan/steerer)
[![license](https://img.shields.io/github/license/stefanprodan/steerer.svg)](https://github.com/stefanprodan/steerer/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/stefanprodan/steerer/all.svg)](https://github.com/stefanprodan/steerer/releases)
[![build](https://travis-ci.org/stefanprodan/flagger.svg?branch=master)](https://travis-ci.org/stefanprodan/flagger)
[![report](https://goreportcard.com/badge/github.com/stefanprodan/flagger)](https://goreportcard.com/report/github.com/stefanprodan/flagger)
[![license](https://img.shields.io/github/license/stefanprodan/flagger.svg)](https://github.com/stefanprodan/flagger/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/stefanprodan/flagger/all.svg)](https://github.com/stefanprodan/flagger/releases)
Steerer is a Kubernetes operator that automates the promotion of canary deployments
Flagger is a Kubernetes operator that automates the promotion of canary deployments
using Istio routing for traffic shifting and Prometheus metrics for canary analysis.
The project is currently in experimental phase and it is expected that breaking changes
to the API will be made in the upcoming releases.
### Install
Before installing Steerer make sure you have Istio setup up with Prometheus enabled.
Before installing Flagger make sure you have Istio setup up with Prometheus enabled.
If you are new to Istio you can follow my [Istio service mesh walk-through](https://github.com/stefanprodan/istio-gke).
Deploy Steerer in the `istio-system` namespace using Helm:
Deploy Flagger in the `istio-system` namespace using Helm:
```bash
# add the Helm repository
helm repo add steerer https://stefanprodan.github.io/steerer
helm repo add flagger https://stefanprodan.github.io/flagger
# install or upgrade
helm upgrade -i steerer steerer/steerer \
helm upgrade -i flagger flagger/flagger \
--namespace=istio-system \
--set metricsServer=http://prometheus.istio-system:9090 \
--set controlLoopInterval=1m
```
Steerer is compatible with Kubernetes >1.10.0 and Istio >1.0.0.
Flagger is compatible with Kubernetes >1.10.0 and Istio >1.0.0.
### Usage
Steerer requires two Kubernetes [deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/):
Flagger requires two Kubernetes [deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/):
one for the version you want to upgrade called _primary_ and one for the _canary_.
Each deployment must have a corresponding ClusterIP [service](https://kubernetes.io/docs/concepts/services-networking/service/)
that exposes a port named http or https. These services are used as destinations in a Istio [virtual service](https://istio.io/docs/reference/config/istio.networking.v1alpha3/#VirtualService).
![steerer-overview](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/diagrams/steerer-overview.png)
![flagger-overview](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/diagrams/flagger-overview.png)
Gated canary promotion stages:
@@ -68,9 +68,9 @@ Gated canary promotion stages:
* mark rollout as finished
* wait for the canary deployment to be updated (revision bump) and start over
You can change the canary analysis _max weight_ and the _step weight_ percentage in the Steerer's custom resource.
You can change the canary analysis _max weight_ and the _step weight_ percentage in the Flagger's custom resource.
Assuming the primary deployment is named _podinfo_ and the canary one _podinfo-canary_, Steerer will require
Assuming the primary deployment is named _podinfo_ and the canary one _podinfo-canary_, Flagger will require
a virtual service configured with weight-based routing:
```yaml
@@ -112,10 +112,10 @@ spec:
targetPort: 9898
```
Based on the two deployments, services and virtual service, a canary promotion can be defined using Steerer's custom resource:
Based on the two deployments, services and virtual service, a canary promotion can be defined using Flagger's custom resource:
```yaml
apiVersion: steerer.app/v1beta1
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfo
@@ -198,12 +198,12 @@ histogram_quantile(0.99,
### Automated canary analysis, promotions and rollbacks
![steerer-canary](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/diagrams/steerer-canary-hpa.png)
![flagger-canary](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/diagrams/flagger-canary-hpa.png)
Create a test namespace with Istio sidecar injection enabled:
```bash
export REPO=https://raw.githubusercontent.com/stefanprodan/steerer/master
export REPO=https://raw.githubusercontent.com/stefanprodan/flagger/master
kubectl apply -f ${REPO}/artifacts/namespaces/test.yaml
```
@@ -248,29 +248,29 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer Starting canary deployment for podinfo.test
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Warning Synced 3m steerer Halt podinfo.test advancement request duration 2.525s > 500ms
Warning Synced 3m steerer Halt podinfo.test advancement request duration 1.567s > 500ms
Warning Synced 3m steerer Halt podinfo.test advancement request duration 823ms > 500ms
Normal Synced 2m steerer Advance podinfo.test canary weight 20
Normal Synced 2m steerer Advance podinfo.test canary weight 25
Normal Synced 1m steerer Advance podinfo.test canary weight 30
Warning Synced 1m steerer Halt podinfo.test advancement success rate 82.33% < 99%
Warning Synced 1m steerer Halt podinfo.test advancement success rate 87.22% < 99%
Warning Synced 1m steerer Halt podinfo.test advancement success rate 94.74% < 99%
Normal Synced 1m steerer Advance podinfo.test canary weight 35
Normal Synced 55s steerer Advance podinfo.test canary weight 40
Normal Synced 45s steerer Advance podinfo.test canary weight 45
Normal Synced 35s steerer Advance podinfo.test canary weight 50
Normal Synced 25s steerer Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s steerer Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s steerer Promotion completed! Scaling down podinfo-canary.test
Normal Synced 3m flagger Starting canary deployment for podinfo.test
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Warning Synced 3m flagger Halt podinfo.test advancement request duration 2.525s > 500ms
Warning Synced 3m flagger Halt podinfo.test advancement request duration 1.567s > 500ms
Warning Synced 3m flagger Halt podinfo.test advancement request duration 823ms > 500ms
Normal Synced 2m flagger Advance podinfo.test canary weight 20
Normal Synced 2m flagger Advance podinfo.test canary weight 25
Normal Synced 1m flagger Advance podinfo.test canary weight 30
Warning Synced 1m flagger Halt podinfo.test advancement success rate 82.33% < 99%
Warning Synced 1m flagger Halt podinfo.test advancement success rate 87.22% < 99%
Warning Synced 1m flagger Halt podinfo.test advancement success rate 94.74% < 99%
Normal Synced 1m flagger Advance podinfo.test canary weight 35
Normal Synced 55s flagger Advance podinfo.test canary weight 40
Normal Synced 45s flagger Advance podinfo.test canary weight 45
Normal Synced 35s flagger Advance podinfo.test canary weight 50
Normal Synced 25s flagger Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s flagger Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s flagger Promotion completed! Scaling down podinfo-canary.test
```
During the canary analysis you can generate HTTP 500 errors and high latency to test if Steerer pauses the rollout.
During the canary analysis you can generate HTTP 500 errors and high latency to test if Flagger pauses the rollout.
Create a tester pod and exec into it:
@@ -304,17 +304,17 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer Starting canary deployment for podinfo.test
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Normal Synced 3m steerer Halt podinfo.test advancement success rate 69.17% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 61.39% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 55.06% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 47.00% < 99%
Normal Synced 2m steerer (combined from similar events): Halt podinfo.test advancement success rate 38.08% < 99%
Warning Synced 1m steerer Rolling back podinfo-canary.test failed checks threshold reached 10
Warning Synced 1m steerer Canary failed! Scaling down podinfo-canary.test
Normal Synced 3m flagger Starting canary deployment for podinfo.test
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Normal Synced 3m flagger Halt podinfo.test advancement success rate 69.17% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 61.39% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 55.06% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 47.00% < 99%
Normal Synced 2m flagger (combined from similar events): Halt podinfo.test advancement success rate 38.08% < 99%
Warning Synced 1m flagger Rolling back podinfo-canary.test failed checks threshold reached 10
Warning Synced 1m flagger Canary failed! Scaling down podinfo-canary.test
```
Trigger a new canary deployment by updating the canary image:
@@ -336,44 +336,44 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer New revision detected podinfo-canary.test old 17211012 new 17246876
Normal Synced 3m steerer Scaling up podinfo.test
Warning Synced 3m steerer Waiting for podinfo.test rollout to finish: 0 of 1 updated replicas are available
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Normal Synced 2m steerer Advance podinfo.test canary weight 20
Normal Synced 2m steerer Advance podinfo.test canary weight 25
Normal Synced 1m steerer Advance podinfo.test canary weight 30
Normal Synced 1m steerer Advance podinfo.test canary weight 35
Normal Synced 55s steerer Advance podinfo.test canary weight 40
Normal Synced 45s steerer Advance podinfo.test canary weight 45
Normal Synced 35s steerer Advance podinfo.test canary weight 50
Normal Synced 25s steerer Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s steerer Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s steerer Promotion completed! Scaling down podinfo-canary.test
Normal Synced 3m flagger New revision detected podinfo-canary.test old 17211012 new 17246876
Normal Synced 3m flagger Scaling up podinfo.test
Warning Synced 3m flagger Waiting for podinfo.test rollout to finish: 0 of 1 updated replicas are available
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Normal Synced 2m flagger Advance podinfo.test canary weight 20
Normal Synced 2m flagger Advance podinfo.test canary weight 25
Normal Synced 1m flagger Advance podinfo.test canary weight 30
Normal Synced 1m flagger Advance podinfo.test canary weight 35
Normal Synced 55s flagger Advance podinfo.test canary weight 40
Normal Synced 45s flagger Advance podinfo.test canary weight 45
Normal Synced 35s flagger Advance podinfo.test canary weight 50
Normal Synced 25s flagger Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s flagger Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s flagger Promotion completed! Scaling down podinfo-canary.test
```
### Monitoring
Steerer comes with a Grafana dashboard made for canary analysis.
Flagger comes with a Grafana dashboard made for canary analysis.
Install Grafana with Helm:
```bash
helm upgrade -i steerer-grafana steerer/grafana \
helm upgrade -i flagger-grafana flagger/grafana \
--namespace=istio-system \
--set url=http://prometheus.istio-system:9090
```
The dashboard shows the RED and USE metrics for the primary and canary workloads:
![steerer-grafana](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/screens/grafana-canary-analysis.png)
![flagger-grafana](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/screens/grafana-canary-analysis.png)
The canary errors and latency spikes have been recorded as Kubernetes events and logged by Steerer in json format:
The canary errors and latency spikes have been recorded as Kubernetes events and logged by Flagger in json format:
```
kubectl -n istio-system logs deployment/steerer --tail=100 | jq .msg
kubectl -n istio-system logs deployment/flagger --tail=100 | jq .msg
Starting canary deployment for podinfo.test
Advance podinfo.test canary weight 5
@@ -403,11 +403,11 @@ Promotion completed! podinfo-canary.test revision 81289
### Contributing
Steerer is Apache 2.0 licensed and accepts contributions via GitHub pull requests.
Flagger is Apache 2.0 licensed and accepts contributions via GitHub pull requests.
When submitting bug reports please include as much details as possible:
* which Steerer version
* which Steerer CRD version
* which Flagger version
* which Flagger CRD version
* which Kubernetes/Istio version
* what configuration (canary, virtual service and workloads definitions)
* what happened (Steerer, Istio Pilot and Proxy logs)
* what happened (Flagger, Istio Pilot and Proxy logs)

View File

@@ -1,17 +1,17 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: steerer
name: flagger
namespace: istio-system
labels:
app: steerer
app: flagger
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: steerer
name: flagger
labels:
app: steerer
app: flagger
rules:
- apiGroups: ['*']
resources: ['*']
@@ -22,14 +22,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: steerer
name: flagger
labels:
app: steerer
app: flagger
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: steerer
name: flagger
subjects:
- kind: ServiceAccount
name: steerer
name: flagger
namespace: istio-system

View File

@@ -1,9 +1,9 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: canaries.steerer.app
name: canaries.flagger.app
spec:
group: steerer.app
group: flagger.app
version: v1beta1
versions:
- name: v1beta1

View File

@@ -1,34 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: steerer
name: flagger
namespace: istio-system
labels:
app: steerer
app: flagger
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: steerer
app: flagger
template:
metadata:
labels:
app: steerer
app: flagger
annotations:
prometheus.io/scrape: "true"
spec:
serviceAccountName: steerer
serviceAccountName: flagger
containers:
- name: steerer
image: stefanprodan/steerer:0.0.1-rc.23
- name: flagger
image: stefanprodan/flagger:0.0.1
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
command:
- ./steerer
- ./flagger
- -log-level=info
- -control-loop-interval=10s
- -metrics-server=http://prometheus.istio-system.svc.cluster.local:9090

View File

@@ -4,7 +4,7 @@
# generate errors: watch curl http://podinfo-canary:9898/status/500
# run load test: kubectl run -n test -it --rm --restart=Never hey --image=stefanprodan/loadtest -- sh
# generate load: hey -z 2m -h2 -m POST -d '{test: 1}' -c 10 -q 5 http://podinfo:9898/api/echo
apiVersion: steerer.app/v1beta1
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfo

View File

@@ -1,4 +1,4 @@
apiVersion: steerer.app/v1beta1
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfoc

View File

@@ -1,5 +1,6 @@
apiVersion: v1
name: steerer
name: flagger
version: 0.0.1
appVersion: 0.0.1-rc.23
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.
appVersion: 0.0.1
description: Flagger is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis.
home: https://github.com/stefanprodan/flagger

View File

@@ -1,36 +1,36 @@
# Steerer
# Flagger
Steerer is a Kubernetes operator that automates the promotion of canary deployments
Flagger is a Kubernetes operator that automates the promotion of canary deployments
using Istio routing for traffic shifting and Prometheus metrics for canary analysis.
## Installing the Chart
To install the chart with the release name `steerer`:
To install the chart with the release name `flagger`:
```console
$ helm upgrade --install steerer ./charts/steerer --namespace=istio-system
$ helm upgrade --install flagger ./charts/flagger --namespace=istio-system
```
The command deploys Steerer on the Kubernetes cluster in the istio-system namespace.
The command deploys Flagger on the Kubernetes cluster in the istio-system namespace.
The [configuration](#configuration) section lists the parameters that can be configured during installation.
## Uninstalling the Chart
To uninstall/delete the `steerer` deployment:
To uninstall/delete the `flagger` deployment:
```console
$ helm delete --purge steerer
$ helm delete --purge flagger
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
The following tables lists the configurable parameters of the Steerer chart and their default values.
The following tables lists the configurable parameters of the Flagger chart and their default values.
Parameter | Description | Default
--- | --- | ---
`image.repository` | image repository | `stefanprodan/steerer`
`image.repository` | image repository | `stefanprodan/flagger`
`image.tag` | image tag | `<VERSION>`
`image.pullPolicy` | image pull policy | `IfNotPresent`
`resources.requests/cpu` | pod CPU request | `10m`
@@ -44,7 +44,7 @@ Parameter | Description | Default
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade`. For example,
```console
$ helm upgrade --install steerer ./charts/steerer \
$ helm upgrade --install flagger ./charts/flagger \
--namespace=istio-system \
--set=image.tag=0.0.2
```
@@ -52,7 +52,7 @@ $ helm upgrade --install steerer ./charts/steerer \
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
$ helm upgrade --install steerer ./charts/steerer \
$ helm upgrade --install flagger ./charts/flagger \
--namespace=istio-system \
-f values.yaml
```

View File

@@ -0,0 +1 @@
Flagger installed

View File

@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "steerer.name" -}}
{{- define "flagger.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "steerer.fullname" -}}
{{- define "flagger.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
@@ -27,6 +27,6 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "steerer.chart" -}}
{{- define "flagger.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -1,9 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "steerer.name" . }}
name: {{ template "flagger.name" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
app: {{ template "flagger.name" . }}
chart: {{ template "flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}

View File

@@ -2,9 +2,9 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: canaries.steerer.app
name: canaries.flagger.app
spec:
group: steerer.app
group: flagger.app
version: v1beta1
versions:
- name: v1beta1

View File

@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "steerer.fullname" . }}
name: {{ include "flagger.fullname" . }}
labels:
app: {{ include "steerer.name" . }}
chart: {{ include "steerer.chart" . }}
app: {{ include "flagger.name" . }}
chart: {{ include "flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -13,17 +13,17 @@ spec:
type: Recreate
selector:
matchLabels:
app: {{ include "steerer.name" . }}
app: {{ include "flagger.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ include "steerer.name" . }}
app: {{ include "flagger.name" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: steerer
serviceAccountName: flagger
containers:
- name: steerer
- name: flagger
securityContext:
readOnlyRootFilesystem: true
runAsUser: 10001
@@ -33,7 +33,7 @@ spec:
- name: http
containerPort: 8080
command:
- ./steerer
- ./flagger
- -log-level=info
- -control-loop-interval={{ .Values.controlLoopInterval }}
- -metrics-server={{ .Values.metricsServer }}

View File

@@ -2,10 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: {{ template "steerer.fullname" . }}
name: {{ template "flagger.fullname" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
app: {{ template "flagger.name" . }}
chart: {{ template "flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
@@ -18,18 +18,18 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: {{ template "steerer.fullname" . }}
name: {{ template "flagger.fullname" . }}
labels:
app: {{ template "steerer.name" . }}
chart: {{ template "steerer.chart" . }}
app: {{ template "flagger.name" . }}
chart: {{ template "flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "steerer.fullname" . }}
name: {{ template "flagger.fullname" . }}
subjects:
- name: {{ template "steerer.name" . }}
- name: {{ template "flagger.name" . }}
namespace: {{ .Release.Namespace | quote }}
kind: ServiceAccount
{{- end }}

View File

@@ -1,8 +1,8 @@
# Default values for steerer.
# Default values for flagger.
image:
repository: stefanprodan/steerer
tag: 0.0.1-rc.23
repository: stefanprodan/flagger
tag: 0.0.1
pullPolicy: IfNotPresent
controlLoopInterval: "10s"

View File

@@ -2,5 +2,5 @@ apiVersion: v1
name: grafana
version: 5.2.4
appVersion: 5.2.0
description: A Helm chart for monitoring progressive deployments powered by Istio and Steerer
home: https://github.com/stefanprodan/steerer
description: A Helm chart for monitoring progressive deployments powered by Istio and Flagger
home: https://github.com/stefanprodan/flagger

View File

@@ -1653,7 +1653,7 @@
]
},
"timezone": "",
"title": "Steerer",
"title": "Flagger",
"uid": "RdykD7tiz",
"version": 2
}

View File

@@ -2,11 +2,11 @@ apiVersion: v1
version: 2.0.0
appVersion: 1.2.1
engine: gotpl
name: podinfo-steerer
description: Podinfo Helm chart for Steerer progressive delivery
name: podinfo-flagger
description: Podinfo Helm chart for Flagger progressive delivery
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
sources:
- https://github.com/stefanprodan/steerer
- https://github.com/stefanprodan/flagger

View File

@@ -47,7 +47,7 @@ spec:
Create the `frontend` release by specifying the external domain name:
```console
helm upgrade frontend -i ./charts/podinfo-steerer \
helm upgrade frontend -i ./charts/podinfo-flagger \
--namespace=test \
--set gateway.enabled=true \
--set gateway.host=podinfo.example.com

View File

@@ -0,0 +1 @@
{{ template "podinfo-flagger.fullname" . }} has been deployed successfully!

View File

@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "podinfo-steerer.name" -}}
{{- define "podinfo-flagger.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
The release name is used as a full name.
*/}}
{{- define "podinfo-steerer.fullname" -}}
{{- define "podinfo-flagger.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
@@ -19,18 +19,18 @@ The release name is used as a full name.
{{- end -}}
{{- end -}}
{{- define "podinfo-steerer.primary" -}}
{{- define "podinfo-flagger.primary" -}}
{{- printf "%s-%s" .Release.Name "primary" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "podinfo-steerer.canary" -}}
{{- define "podinfo-flagger.canary" -}}
{{- printf "%s-%s" .Release.Name "canary" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "podinfo-steerer.chart" -}}
{{- define "podinfo-flagger.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "podinfo-steerer.canary" . }}
name: {{ template "podinfo-flagger.canary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -14,11 +14,11 @@ spec:
maxUnavailable: 0
selector:
matchLabels:
app: {{ template "podinfo-steerer.canary" . }}
app: {{ template "podinfo-flagger.canary" . }}
template:
metadata:
labels:
app: {{ template "podinfo-steerer.canary" . }}
app: {{ template "podinfo-flagger.canary" . }}
annotations:
prometheus.io/scrape: "true"
spec:

View File

@@ -1,17 +1,17 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "podinfo-steerer.canary" . }}
name: {{ template "podinfo-flagger.canary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "podinfo-steerer.canary" . }}
name: {{ template "podinfo-flagger.canary" . }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:

View File

@@ -1,10 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "podinfo-steerer.canary" . }}
name: {{ template "podinfo-flagger.canary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -15,4 +15,4 @@ spec:
protocol: TCP
name: http
selector:
app: {{ template "podinfo-steerer.canary" . }}
app: {{ template "podinfo-flagger.canary" . }}

View File

@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "podinfo-steerer.primary" . }}
name: {{ template "podinfo-flagger.primary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -14,11 +14,11 @@ spec:
maxUnavailable: 0
selector:
matchLabels:
app: {{ template "podinfo-steerer.primary" . }}
app: {{ template "podinfo-flagger.primary" . }}
template:
metadata:
labels:
app: {{ template "podinfo-steerer.primary" . }}
app: {{ template "podinfo-flagger.primary" . }}
annotations:
prometheus.io/scrape: "true"
spec:

View File

@@ -1,17 +1,17 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "podinfo-steerer.primary" . }}
name: {{ template "podinfo-flagger.primary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "podinfo-steerer.primary" . }}
name: {{ template "podinfo-flagger.primary" . }}
minReplicas: {{ .Values.hpa.minReplicas }}
maxReplicas: {{ .Values.hpa.maxReplicas }}
metrics:

View File

@@ -1,10 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "podinfo-steerer.primary" . }}
name: {{ template "podinfo-flagger.primary" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
@@ -15,4 +15,4 @@ spec:
protocol: TCP
name: http
selector:
app: {{ template "podinfo-steerer.primary" . }}
app: {{ template "podinfo-flagger.primary" . }}

View File

@@ -1,15 +1,15 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ template "podinfo-steerer.fullname" . }}
name: {{ template "podinfo-flagger.fullname" . }}
labels:
app: {{ template "podinfo-steerer.fullname" . }}
chart: {{ template "podinfo-steerer.chart" . }}
app: {{ template "podinfo-flagger.fullname" . }}
chart: {{ template "podinfo-flagger.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
hosts:
- {{ template "podinfo-steerer.fullname" . }}
- {{ template "podinfo-flagger.fullname" . }}
{{- if .Values.gateway.enabled }}
- {{ .Values.gateway.host }}
gateways:
@@ -18,12 +18,12 @@ spec:
http:
- route:
- destination:
host: {{ template "podinfo-steerer.primary" . }}
host: {{ template "podinfo-flagger.primary" . }}
port:
number: {{ .Values.containerPort }}
weight: 100
- destination:
host: {{ template "podinfo-steerer.canary" . }}
host: {{ template "podinfo-flagger.canary" . }}
port:
number: {{ .Values.containerPort }}
weight: 0

View File

@@ -1,4 +1,4 @@
# Default values for podinfo-steerer.
# Default values for podinfo-flagger.
image:
repository: quay.io/stefanprodan/podinfo

View File

@@ -1 +0,0 @@
{{ template "podinfo-steerer.fullname" . }} has been deployed successfully!

View File

@@ -1 +0,0 @@
Steerer installed

View File

@@ -8,12 +8,12 @@ import (
_ "github.com/istio/glog"
sharedclientset "github.com/knative/pkg/client/clientset/versioned"
"github.com/knative/pkg/signals"
clientset "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
informers "github.com/stefanprodan/steerer/pkg/client/informers/externalversions"
"github.com/stefanprodan/steerer/pkg/controller"
"github.com/stefanprodan/steerer/pkg/logging"
"github.com/stefanprodan/steerer/pkg/server"
"github.com/stefanprodan/steerer/pkg/version"
clientset "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
informers "github.com/stefanprodan/flagger/pkg/client/informers/externalversions"
"github.com/stefanprodan/flagger/pkg/controller"
"github.com/stefanprodan/flagger/pkg/logging"
"github.com/stefanprodan/flagger/pkg/server"
"github.com/stefanprodan/flagger/pkg/version"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/tools/cache"
@@ -70,9 +70,9 @@ func main() {
}
rolloutInformerFactory := informers.NewSharedInformerFactory(rolloutClient, time.Second*30)
rolloutInformer := rolloutInformerFactory.Steerer().V1beta1().Canaries()
rolloutInformer := rolloutInformerFactory.Flagger().V1beta1().Canaries()
logger.Infof("Starting steerer version %s revision %s", version.VERSION, version.REVISION)
logger.Infof("Starting flagger version %s revision %s", version.VERSION, version.REVISION)
ver, err := kubeClient.Discovery().ServerVersion()
if err != nil {

View File

@@ -1 +1 @@
steerer.app
flagger.app

View File

@@ -1,43 +1,43 @@
# steerer
# flagger
[![build](https://travis-ci.org/stefanprodan/steerer.svg?branch=master)](https://travis-ci.org/stefanprodan/steerer)
[![report](https://goreportcard.com/badge/github.com/stefanprodan/steerer)](https://goreportcard.com/report/github.com/stefanprodan/steerer)
[![license](https://img.shields.io/github/license/stefanprodan/steerer.svg)](https://github.com/stefanprodan/steerer/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/stefanprodan/steerer/all.svg)](https://github.com/stefanprodan/steerer/releases)
[![build](https://travis-ci.org/stefanprodan/flagger.svg?branch=master)](https://travis-ci.org/stefanprodan/flagger)
[![report](https://goreportcard.com/badge/github.com/stefanprodan/flagger)](https://goreportcard.com/report/github.com/stefanprodan/flagger)
[![license](https://img.shields.io/github/license/stefanprodan/flagger.svg)](https://github.com/stefanprodan/flagger/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/stefanprodan/flagger/all.svg)](https://github.com/stefanprodan/flagger/releases)
Steerer is a Kubernetes operator that automates the promotion of canary deployments
Flagger is a Kubernetes operator that automates the promotion of canary deployments
using Istio routing for traffic shifting and Prometheus metrics for canary analysis.
The project is currently in experimental phase and it is expected that breaking changes
to the API will be made in the upcoming releases.
### Install
Before installing Steerer make sure you have Istio setup up with Prometheus enabled.
Before installing Flagger make sure you have Istio setup up with Prometheus enabled.
If you are new to Istio you can follow my [Istio service mesh walk-through](https://github.com/stefanprodan/istio-gke).
Deploy Steerer in the `istio-system` namespace using Helm:
Deploy Flagger in the `istio-system` namespace using Helm:
```bash
# add the Helm repository
helm repo add steerer https://stefanprodan.github.io/steerer
helm repo add flagger https://stefanprodan.github.io/flagger
# install or upgrade
helm upgrade -i steerer steerer/steerer \
helm upgrade -i flagger flagger/flagger \
--namespace=istio-system \
--set metricsServer=http://prometheus.istio-system:9090 \
--set controlLoopInterval=1m
```
Steerer is compatible with Kubernetes >1.10.0 and Istio >1.0.0.
Flagger is compatible with Kubernetes >1.10.0 and Istio >1.0.0.
### Usage
Steerer requires two Kubernetes [deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/):
Flagger requires two Kubernetes [deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/):
one for the version you want to upgrade called _primary_ and one for the _canary_.
Each deployment must have a corresponding ClusterIP [service](https://kubernetes.io/docs/concepts/services-networking/service/)
that exposes a port named http or https. These services are used as destinations in a Istio [virtual service](https://istio.io/docs/reference/config/istio.networking.v1alpha3/#VirtualService).
![steerer-overview](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/diagrams/steerer-overview.png)
![flagger-overview](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/diagrams/flagger-overview.png)
Gated canary promotion stages:
@@ -68,9 +68,9 @@ Gated canary promotion stages:
* mark rollout as finished
* wait for the canary deployment to be updated (revision bump) and start over
You can change the canary analysis _max weight_ and the _step weight_ percentage in the Steerer's custom resource.
You can change the canary analysis _max weight_ and the _step weight_ percentage in the Flagger's custom resource.
Assuming the primary deployment is named _podinfo_ and the canary one _podinfo-canary_, Steerer will require
Assuming the primary deployment is named _podinfo_ and the canary one _podinfo-canary_, Flagger will require
a virtual service configured with weight-based routing:
```yaml
@@ -112,10 +112,10 @@ spec:
targetPort: 9898
```
Based on the two deployments, services and virtual service, a canary promotion can be defined using Steerer's custom resource:
Based on the two deployments, services and virtual service, a canary promotion can be defined using Flagger's custom resource:
```yaml
apiVersion: steerer.app/v1beta1
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfo
@@ -198,12 +198,12 @@ histogram_quantile(0.99,
### Automated canary analysis, promotions and rollbacks
![steerer-canary](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/diagrams/steerer-canary-hpa.png)
![flagger-canary](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/diagrams/flagger-canary-hpa.png)
Create a test namespace with Istio sidecar injection enabled:
```bash
export REPO=https://raw.githubusercontent.com/stefanprodan/steerer/master
export REPO=https://raw.githubusercontent.com/stefanprodan/flagger/master
kubectl apply -f ${REPO}/artifacts/namespaces/test.yaml
```
@@ -248,29 +248,29 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer Starting canary deployment for podinfo.test
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Warning Synced 3m steerer Halt podinfo.test advancement request duration 2.525s > 500ms
Warning Synced 3m steerer Halt podinfo.test advancement request duration 1.567s > 500ms
Warning Synced 3m steerer Halt podinfo.test advancement request duration 823ms > 500ms
Normal Synced 2m steerer Advance podinfo.test canary weight 20
Normal Synced 2m steerer Advance podinfo.test canary weight 25
Normal Synced 1m steerer Advance podinfo.test canary weight 30
Warning Synced 1m steerer Halt podinfo.test advancement success rate 82.33% < 99%
Warning Synced 1m steerer Halt podinfo.test advancement success rate 87.22% < 99%
Warning Synced 1m steerer Halt podinfo.test advancement success rate 94.74% < 99%
Normal Synced 1m steerer Advance podinfo.test canary weight 35
Normal Synced 55s steerer Advance podinfo.test canary weight 40
Normal Synced 45s steerer Advance podinfo.test canary weight 45
Normal Synced 35s steerer Advance podinfo.test canary weight 50
Normal Synced 25s steerer Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s steerer Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s steerer Promotion completed! Scaling down podinfo-canary.test
Normal Synced 3m flagger Starting canary deployment for podinfo.test
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Warning Synced 3m flagger Halt podinfo.test advancement request duration 2.525s > 500ms
Warning Synced 3m flagger Halt podinfo.test advancement request duration 1.567s > 500ms
Warning Synced 3m flagger Halt podinfo.test advancement request duration 823ms > 500ms
Normal Synced 2m flagger Advance podinfo.test canary weight 20
Normal Synced 2m flagger Advance podinfo.test canary weight 25
Normal Synced 1m flagger Advance podinfo.test canary weight 30
Warning Synced 1m flagger Halt podinfo.test advancement success rate 82.33% < 99%
Warning Synced 1m flagger Halt podinfo.test advancement success rate 87.22% < 99%
Warning Synced 1m flagger Halt podinfo.test advancement success rate 94.74% < 99%
Normal Synced 1m flagger Advance podinfo.test canary weight 35
Normal Synced 55s flagger Advance podinfo.test canary weight 40
Normal Synced 45s flagger Advance podinfo.test canary weight 45
Normal Synced 35s flagger Advance podinfo.test canary weight 50
Normal Synced 25s flagger Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s flagger Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s flagger Promotion completed! Scaling down podinfo-canary.test
```
During the canary analysis you can generate HTTP 500 errors and high latency to test if Steerer pauses the rollout.
During the canary analysis you can generate HTTP 500 errors and high latency to test if Flagger pauses the rollout.
Create a tester pod and exec into it:
@@ -304,17 +304,17 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer Starting canary deployment for podinfo.test
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Normal Synced 3m steerer Halt podinfo.test advancement success rate 69.17% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 61.39% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 55.06% < 99%
Normal Synced 2m steerer Halt podinfo.test advancement success rate 47.00% < 99%
Normal Synced 2m steerer (combined from similar events): Halt podinfo.test advancement success rate 38.08% < 99%
Warning Synced 1m steerer Rolling back podinfo-canary.test failed checks threshold reached 10
Warning Synced 1m steerer Canary failed! Scaling down podinfo-canary.test
Normal Synced 3m flagger Starting canary deployment for podinfo.test
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Normal Synced 3m flagger Halt podinfo.test advancement success rate 69.17% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 61.39% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 55.06% < 99%
Normal Synced 2m flagger Halt podinfo.test advancement success rate 47.00% < 99%
Normal Synced 2m flagger (combined from similar events): Halt podinfo.test advancement success rate 38.08% < 99%
Warning Synced 1m flagger Rolling back podinfo-canary.test failed checks threshold reached 10
Warning Synced 1m flagger Canary failed! Scaling down podinfo-canary.test
```
Trigger a new canary deployment by updating the canary image:
@@ -336,44 +336,44 @@ Status:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Synced 3m steerer New revision detected podinfo-canary.test old 17211012 new 17246876
Normal Synced 3m steerer Scaling up podinfo.test
Warning Synced 3m steerer Waiting for podinfo.test rollout to finish: 0 of 1 updated replicas are available
Normal Synced 3m steerer Advance podinfo.test canary weight 5
Normal Synced 3m steerer Advance podinfo.test canary weight 10
Normal Synced 3m steerer Advance podinfo.test canary weight 15
Normal Synced 2m steerer Advance podinfo.test canary weight 20
Normal Synced 2m steerer Advance podinfo.test canary weight 25
Normal Synced 1m steerer Advance podinfo.test canary weight 30
Normal Synced 1m steerer Advance podinfo.test canary weight 35
Normal Synced 55s steerer Advance podinfo.test canary weight 40
Normal Synced 45s steerer Advance podinfo.test canary weight 45
Normal Synced 35s steerer Advance podinfo.test canary weight 50
Normal Synced 25s steerer Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s steerer Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s steerer Promotion completed! Scaling down podinfo-canary.test
Normal Synced 3m flagger New revision detected podinfo-canary.test old 17211012 new 17246876
Normal Synced 3m flagger Scaling up podinfo.test
Warning Synced 3m flagger Waiting for podinfo.test rollout to finish: 0 of 1 updated replicas are available
Normal Synced 3m flagger Advance podinfo.test canary weight 5
Normal Synced 3m flagger Advance podinfo.test canary weight 10
Normal Synced 3m flagger Advance podinfo.test canary weight 15
Normal Synced 2m flagger Advance podinfo.test canary weight 20
Normal Synced 2m flagger Advance podinfo.test canary weight 25
Normal Synced 1m flagger Advance podinfo.test canary weight 30
Normal Synced 1m flagger Advance podinfo.test canary weight 35
Normal Synced 55s flagger Advance podinfo.test canary weight 40
Normal Synced 45s flagger Advance podinfo.test canary weight 45
Normal Synced 35s flagger Advance podinfo.test canary weight 50
Normal Synced 25s flagger Copying podinfo-canary.test template spec to podinfo.test
Warning Synced 15s flagger Waiting for podinfo.test rollout to finish: 1 of 2 updated replicas are available
Normal Synced 5s flagger Promotion completed! Scaling down podinfo-canary.test
```
### Monitoring
Steerer comes with a Grafana dashboard made for canary analysis.
Flagger comes with a Grafana dashboard made for canary analysis.
Install Grafana with Helm:
```bash
helm upgrade -i steerer-grafana steerer/grafana \
helm upgrade -i flagger-grafana flagger/grafana \
--namespace=istio-system \
--set url=http://prometheus.istio-system:9090
```
The dashboard shows the RED and USE metrics for the primary and canary workloads:
![steerer-grafana](https://raw.githubusercontent.com/stefanprodan/steerer/master/docs/screens/grafana-canary-analysis.png)
![flagger-grafana](https://raw.githubusercontent.com/stefanprodan/flagger/master/docs/screens/grafana-canary-analysis.png)
The canary errors and latency spikes have been recorded as Kubernetes events and logged by Steerer in json format:
The canary errors and latency spikes have been recorded as Kubernetes events and logged by Flagger in json format:
```
kubectl -n istio-system logs deployment/steerer --tail=100 | jq .msg
kubectl -n istio-system logs deployment/flagger --tail=100 | jq .msg
Starting canary deployment for podinfo.test
Advance podinfo.test canary weight 5
@@ -403,11 +403,11 @@ Promotion completed! podinfo-canary.test revision 81289
### Contributing
Steerer is Apache 2.0 licensed and accepts contributions via GitHub pull requests.
Flagger is Apache 2.0 licensed and accepts contributions via GitHub pull requests.
When submitting bug reports please include as much details as possible:
* which Steerer version
* which Steerer CRD version
* which Flagger version
* which Flagger CRD version
* which Kubernetes/Istio version
* what configuration (canary, virtual service and workloads definitions)
* what happened (Steerer, Istio Pilot and Proxy logs)
* what happened (Flagger, Istio Pilot and Proxy logs)

View File

@@ -1,10 +1,10 @@
title: Steerer - Istio Progressive Delivery Kubernetes Operator
title: Flagger - Istio Progressive Delivery Kubernetes Operator
remote_theme: errordeveloper/simple-project-homepage
repository: stefanprodan/steerer
repository: stefanprodan/flagger
by_weaveworks: true
url: "https://stefanprodan.github.io/steerer"
url: "https://stefanprodan.github.io/flagger"
baseurl: "/"
twitter:
@@ -15,7 +15,7 @@ author:
# Set default og:image
defaults:
- scope: {path: ""}
values: {image: "logo/logo-steerer.png"}
values: {image: "logo/logo-flagger.png"}
# See: https://material.io/guidelines/style/color.html
# Use color-name-value, like pink-200 or deep-purple-100

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

BIN
docs/flagger-0.0.1.tgz Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,60 +1,61 @@
apiVersion: v1
entries:
flagger:
- apiVersion: v1
appVersion: 0.0.1
created: 2018-10-07T13:00:10.107115+03:00
description: Flagger is a Kubernetes operator that automates the promotion of
canary deployments using Istio routing for traffic shifting and Prometheus metrics
for canary analysis.
digest: ddf0eda9975979bdfc26f10c7b3c15f4a31ebe0484be3285fbaec99b893871be
home: https://github.com/stefanprodan/flagger
name: flagger
urls:
- https://stefanprodan.github.io/flagger/flagger-0.0.1.tgz
version: 0.0.1
grafana:
- apiVersion: v1
appVersion: 5.2.0
created: 2018-10-04T14:48:57.585857+03:00
created: 2018-10-07T13:00:10.10763+03:00
description: A Helm chart for monitoring progressive deployments powered by Istio
and Steerer
digest: f8cac4d99069abdffd432b0c7e741aa1cf3c6f88435fd1cc54c00004514d740d
home: https://github.com/stefanprodan/steerer
and Flagger
digest: 1e19e9010d2939e19d0f8465287676b185f4772f5df5a75092a8fce0b4a50e5e
home: https://github.com/stefanprodan/flagger
name: grafana
urls:
- https://stefanprodan.github.io/steerer/grafana-5.2.4.tgz
- https://stefanprodan.github.io/flagger/grafana-5.2.4.tgz
version: 5.2.4
podinfo-steerer:
podinfo-flagger:
- apiVersion: v1
appVersion: 1.2.1
created: 2018-10-04T14:48:57.586743+03:00
description: Podinfo Helm chart for Steerer progressive delivery
digest: 0d9a5037f9765cb74882bcbc1c873527b49af742bdde5ea9ca8c674efcfcb178
created: 2018-10-07T13:00:10.108001+03:00
description: Podinfo Helm chart for Flagger progressive delivery
digest: 35ce41d10df123a785ba359491668a143c5918ce6d3d24f5b545ca2cb9134d91
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
name: podinfo-steerer
name: podinfo-flagger
sources:
- https://github.com/stefanprodan/steerer
- https://github.com/stefanprodan/flagger
urls:
- https://stefanprodan.github.io/steerer/podinfo-steerer-2.0.0.tgz
- https://stefanprodan.github.io/flagger/podinfo-flagger-2.0.0.tgz
version: 2.0.0
- apiVersion: v1
appVersion: 1.2.1
created: 2018-10-04T14:48:57.586403+03:00
description: Podinfo Helm chart for Steerer progressive delivery
description: Podinfo Helm chart for Flagger progressive delivery
digest: f559f387aa45005be085af207b8b4c91776e489fcb6ca7e60f20913ecd21184e
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
name: podinfo-steerer
name: podinfo-flagger
sources:
- https://github.com/stefanprodan/steerer
- https://github.com/stefanprodan/flagger
urls:
- https://stefanprodan.github.io/steerer/podinfo-steerer-1.2.1.tgz
- https://stefanprodan.github.io/flagger/podinfo-flagger-1.2.1.tgz
version: 1.2.1
steerer:
- apiVersion: v1
appVersion: 0.0.1-rc.23
created: 2018-10-04T14:48:57.587058+03:00
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.
digest: e403eb0e6aff36146d00f0dc56820fd5a464acf6509b5d715e937757bbb29aac
name: steerer
urls:
- https://stefanprodan.github.io/steerer/steerer-0.0.1.tgz
version: 0.0.1
generated: 2018-10-04T14:48:57.584927+03:00
generated: 2018-10-07T13:00:10.106238+03:00

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -22,7 +22,7 @@ SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/stefanprodan/steerer/pkg/client github.com/stefanprodan/steerer/pkg/apis \
rollout:v1beta1 \
github.com/stefanprodan/flagger/pkg/client github.com/stefanprodan/flagger/pkg/apis \
flagger:v1beta1 \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Authors.
Copyright 2018 The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package rollout
package flagger
const (
GroupName = "steerer.app"
GroupName = "flagger.app"
)

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Authors.
Copyright 2018 The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,5 +17,5 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// Package v1beta1 is the v1beta1 version of the API.
// +groupName=steerer.app
// +groupName=flagger.app
package v1beta1

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Authors.
Copyright 2018 The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
rollout "github.com/stefanprodan/steerer/pkg/apis/rollout"
rollout "github.com/stefanprodan/flagger/pkg/apis/flagger"
)
// SchemeGroupVersion is group version used to register these objects

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 The Kubernetes Authors.
Copyright 2018 The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package versioned
import (
steererv1beta1 "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/typed/rollout/v1beta1"
flaggerv1beta1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
@@ -27,27 +27,27 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
SteererV1beta1() steererv1beta1.SteererV1beta1Interface
FlaggerV1beta1() flaggerv1beta1.FlaggerV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Steerer() steererv1beta1.SteererV1beta1Interface
Flagger() flaggerv1beta1.FlaggerV1beta1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
steererV1beta1 *steererv1beta1.SteererV1beta1Client
flaggerV1beta1 *flaggerv1beta1.FlaggerV1beta1Client
}
// SteererV1beta1 retrieves the SteererV1beta1Client
func (c *Clientset) SteererV1beta1() steererv1beta1.SteererV1beta1Interface {
return c.steererV1beta1
// FlaggerV1beta1 retrieves the FlaggerV1beta1Client
func (c *Clientset) FlaggerV1beta1() flaggerv1beta1.FlaggerV1beta1Interface {
return c.flaggerV1beta1
}
// Deprecated: Steerer retrieves the default version of SteererClient.
// Deprecated: Flagger retrieves the default version of FlaggerClient.
// Please explicitly pick a version.
func (c *Clientset) Steerer() steererv1beta1.SteererV1beta1Interface {
return c.steererV1beta1
func (c *Clientset) Flagger() flaggerv1beta1.FlaggerV1beta1Interface {
return c.flaggerV1beta1
}
// Discovery retrieves the DiscoveryClient
@@ -66,7 +66,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
}
var cs Clientset
var err error
cs.steererV1beta1, err = steererv1beta1.NewForConfig(&configShallowCopy)
cs.flaggerV1beta1, err = flaggerv1beta1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
@@ -82,7 +82,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.steererV1beta1 = steererv1beta1.NewForConfigOrDie(c)
cs.flaggerV1beta1 = flaggerv1beta1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@@ -91,7 +91,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.steererV1beta1 = steererv1beta1.New(c)
cs.flaggerV1beta1 = flaggerv1beta1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@ limitations under the License.
package fake
import (
clientset "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
steererv1beta1 "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/typed/rollout/v1beta1"
fakesteererv1beta1 "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/typed/rollout/v1beta1/fake"
clientset "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
flaggerv1beta1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
fakeflaggerv1beta1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
@@ -71,12 +71,12 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
var _ clientset.Interface = &Clientset{}
// SteererV1beta1 retrieves the SteererV1beta1Client
func (c *Clientset) SteererV1beta1() steererv1beta1.SteererV1beta1Interface {
return &fakesteererv1beta1.FakeSteererV1beta1{Fake: &c.Fake}
// FlaggerV1beta1 retrieves the FlaggerV1beta1Client
func (c *Clientset) FlaggerV1beta1() flaggerv1beta1.FlaggerV1beta1Interface {
return &fakeflaggerv1beta1.FakeFlaggerV1beta1{Fake: &c.Fake}
}
// Steerer retrieves the SteererV1beta1Client
func (c *Clientset) Steerer() steererv1beta1.SteererV1beta1Interface {
return &fakesteererv1beta1.FakeSteererV1beta1{Fake: &c.Fake}
// Flagger retrieves the FlaggerV1beta1Client
func (c *Clientset) Flagger() flaggerv1beta1.FlaggerV1beta1Interface {
return &fakeflaggerv1beta1.FakeFlaggerV1beta1{Fake: &c.Fake}
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
steererv1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
flaggerv1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -50,5 +50,5 @@ func init() {
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
steererv1beta1.AddToScheme(scheme)
flaggerv1beta1.AddToScheme(scheme)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package scheme
import (
steererv1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
flaggerv1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -50,5 +50,5 @@ func init() {
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
steererv1beta1.AddToScheme(scheme)
flaggerv1beta1.AddToScheme(scheme)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ limitations under the License.
package v1beta1
import (
v1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
scheme "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/scheme"
v1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
scheme "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
@@ -54,7 +54,7 @@ type canaries struct {
}
// newCanaries returns a Canaries
func newCanaries(c *SteererV1beta1Client, namespace string) *canaries {
func newCanaries(c *FlaggerV1beta1Client, namespace string) *canaries {
return &canaries{
client: c.RESTClient(),
ns: namespace,

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
v1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
v1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -30,13 +30,13 @@ import (
// FakeCanaries implements CanaryInterface
type FakeCanaries struct {
Fake *FakeSteererV1beta1
Fake *FakeFlaggerV1beta1
ns string
}
var canariesResource = schema.GroupVersionResource{Group: "steerer.app", Version: "v1beta1", Resource: "canaries"}
var canariesResource = schema.GroupVersionResource{Group: "flagger.app", Version: "v1beta1", Resource: "canaries"}
var canariesKind = schema.GroupVersionKind{Group: "steerer.app", Version: "v1beta1", Kind: "Canary"}
var canariesKind = schema.GroupVersionKind{Group: "flagger.app", Version: "v1beta1", Kind: "Canary"}
// Get takes name of the canary, and returns the corresponding canary object, and an error if there is any.
func (c *FakeCanaries) Get(name string, options v1.GetOptions) (result *v1beta1.Canary, err error) {

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,22 +19,22 @@ limitations under the License.
package fake
import (
v1beta1 "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/typed/rollout/v1beta1"
v1beta1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeSteererV1beta1 struct {
type FakeFlaggerV1beta1 struct {
*testing.Fake
}
func (c *FakeSteererV1beta1) Canaries(namespace string) v1beta1.CanaryInterface {
func (c *FakeFlaggerV1beta1) Canaries(namespace string) v1beta1.CanaryInterface {
return &FakeCanaries{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeSteererV1beta1) RESTClient() rest.Interface {
func (c *FakeFlaggerV1beta1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,28 +19,28 @@ limitations under the License.
package v1beta1
import (
v1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
"github.com/stefanprodan/steerer/pkg/client/clientset/versioned/scheme"
v1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
"github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type SteererV1beta1Interface interface {
type FlaggerV1beta1Interface interface {
RESTClient() rest.Interface
CanariesGetter
}
// SteererV1beta1Client is used to interact with features provided by the steerer.app group.
type SteererV1beta1Client struct {
// FlaggerV1beta1Client is used to interact with features provided by the flagger.app group.
type FlaggerV1beta1Client struct {
restClient rest.Interface
}
func (c *SteererV1beta1Client) Canaries(namespace string) CanaryInterface {
func (c *FlaggerV1beta1Client) Canaries(namespace string) CanaryInterface {
return newCanaries(c, namespace)
}
// NewForConfig creates a new SteererV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*SteererV1beta1Client, error) {
// NewForConfig creates a new FlaggerV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*FlaggerV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@@ -49,12 +49,12 @@ func NewForConfig(c *rest.Config) (*SteererV1beta1Client, error) {
if err != nil {
return nil, err
}
return &SteererV1beta1Client{client}, nil
return &FlaggerV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new SteererV1beta1Client for the given config and
// NewForConfigOrDie creates a new FlaggerV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *SteererV1beta1Client {
func NewForConfigOrDie(c *rest.Config) *FlaggerV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@@ -62,9 +62,9 @@ func NewForConfigOrDie(c *rest.Config) *SteererV1beta1Client {
return client
}
// New creates a new SteererV1beta1Client for the given RESTClient.
func New(c rest.Interface) *SteererV1beta1Client {
return &SteererV1beta1Client{c}
// New creates a new FlaggerV1beta1Client for the given RESTClient.
func New(c rest.Interface) *FlaggerV1beta1Client {
return &FlaggerV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
@@ -82,7 +82,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *SteererV1beta1Client) RESTClient() rest.Interface {
func (c *FlaggerV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@ import (
sync "sync"
time "time"
versioned "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
internalinterfaces "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/internalinterfaces"
rollout "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/rollout"
versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
flagger "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/flagger"
internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@@ -172,9 +172,9 @@ type SharedInformerFactory interface {
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
Steerer() rollout.Interface
Flagger() flagger.Interface
}
func (f *sharedInformerFactory) Steerer() rollout.Interface {
return rollout.New(f, f.namespace, f.tweakListOptions)
func (f *sharedInformerFactory) Flagger() flagger.Interface {
return flagger.New(f, f.namespace, f.tweakListOptions)
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,11 +16,11 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package steerer
package flagger
import (
internalinterfaces "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/internalinterfaces"
v1beta1 "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/rollout/v1beta1"
v1beta1 "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/flagger/v1beta1"
internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces"
)
// Interface provides access to each of this group's versions.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@ package v1beta1
import (
time "time"
rolloutv1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
versioned "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
internalinterfaces "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/internalinterfaces"
v1beta1 "github.com/stefanprodan/steerer/pkg/client/listers/rollout/v1beta1"
flaggerv1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces"
v1beta1 "github.com/stefanprodan/flagger/pkg/client/listers/flagger/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
@@ -61,16 +61,16 @@ func NewFilteredCanaryInformer(client versioned.Interface, namespace string, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SteererV1beta1().Canaries(namespace).List(options)
return client.FlaggerV1beta1().Canaries(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SteererV1beta1().Canaries(namespace).Watch(options)
return client.FlaggerV1beta1().Canaries(namespace).Watch(options)
},
},
&rolloutv1beta1.Canary{},
&flaggerv1beta1.Canary{},
resyncPeriod,
indexers,
)
@@ -81,7 +81,7 @@ func (f *canaryInformer) defaultInformer(client versioned.Interface, resyncPerio
}
func (f *canaryInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rolloutv1beta1.Canary{}, f.defaultInformer)
return f.factory.InformerFor(&flaggerv1beta1.Canary{}, f.defaultInformer)
}
func (f *canaryInformer) Lister() v1beta1.CanaryLister {

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package v1beta1
import (
internalinterfaces "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/internalinterfaces"
internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ package externalversions
import (
"fmt"
v1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
v1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
@@ -52,9 +52,9 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=steerer.app, Version=v1beta1
// Group=flagger.app, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithResource("canaries"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Steerer().V1beta1().Canaries().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.Flagger().V1beta1().Canaries().Informer()}, nil
}

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ package internalinterfaces
import (
time "time"
versioned "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ limitations under the License.
package v1beta1
import (
v1beta1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
v1beta1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"

View File

@@ -1,5 +1,5 @@
/*
Copyright The Authors.
Copyright The Flagger Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -7,11 +7,11 @@ import (
"github.com/google/go-cmp/cmp"
istioclientset "github.com/knative/pkg/client/clientset/versioned"
rolloutv1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
clientset "github.com/stefanprodan/steerer/pkg/client/clientset/versioned"
rolloutscheme "github.com/stefanprodan/steerer/pkg/client/clientset/versioned/scheme"
rolloutinformers "github.com/stefanprodan/steerer/pkg/client/informers/externalversions/rollout/v1beta1"
rolloutlisters "github.com/stefanprodan/steerer/pkg/client/listers/rollout/v1beta1"
flaggerv1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
clientset "github.com/stefanprodan/flagger/pkg/client/clientset/versioned"
flaggerscheme "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme"
flaggerinformers "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/flagger/v1beta1"
flaggerlisters "github.com/stefanprodan/flagger/pkg/client/listers/flagger/v1beta1"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
@@ -25,13 +25,13 @@ import (
"k8s.io/client-go/util/workqueue"
)
const controllerAgentName = "steerer"
const controllerAgentName = "flagger"
type Controller struct {
kubeClient kubernetes.Interface
istioClient istioclientset.Interface
rolloutClient clientset.Interface
rolloutLister rolloutlisters.CanaryLister
rolloutLister flaggerlisters.CanaryLister
rolloutSynced cache.InformerSynced
rolloutWindow time.Duration
workqueue workqueue.RateLimitingInterface
@@ -45,14 +45,14 @@ func NewController(
kubeClient kubernetes.Interface,
istioClient istioclientset.Interface,
rolloutClient clientset.Interface,
rolloutInformer rolloutinformers.CanaryInformer,
rolloutInformer flaggerinformers.CanaryInformer,
rolloutWindow time.Duration,
metricServer string,
logger *zap.SugaredLogger,
) *Controller {
logger.Debug("Creating event broadcaster")
rolloutscheme.AddToScheme(scheme.Scheme)
flaggerscheme.AddToScheme(scheme.Scheme)
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(logger.Named("event-broadcaster").Debugf)
eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{
@@ -196,27 +196,27 @@ func (c *Controller) enqueueRollout(obj interface{}) {
c.workqueue.AddRateLimited(key)
}
func (c *Controller) recordEventInfof(r *rolloutv1.Canary, template string, args ...interface{}) {
func (c *Controller) recordEventInfof(r *flaggerv1.Canary, template string, args ...interface{}) {
c.logger.Infof(template, args...)
c.recorder.Event(r, corev1.EventTypeNormal, "Synced", fmt.Sprintf(template, args...))
}
func (c *Controller) recordEventErrorf(r *rolloutv1.Canary, template string, args ...interface{}) {
func (c *Controller) recordEventErrorf(r *flaggerv1.Canary, template string, args ...interface{}) {
c.logger.Errorf(template, args...)
c.recorder.Event(r, corev1.EventTypeWarning, "Synced", fmt.Sprintf(template, args...))
}
func (c *Controller) recordEventWarningf(r *rolloutv1.Canary, template string, args ...interface{}) {
func (c *Controller) recordEventWarningf(r *flaggerv1.Canary, template string, args ...interface{}) {
c.logger.Infof(template, args...)
c.recorder.Event(r, corev1.EventTypeWarning, "Synced", fmt.Sprintf(template, args...))
}
func checkCustomResourceType(obj interface{}, logger *zap.SugaredLogger) (rolloutv1.Canary, bool) {
var roll *rolloutv1.Canary
func checkCustomResourceType(obj interface{}, logger *zap.SugaredLogger) (flaggerv1.Canary, bool) {
var roll *flaggerv1.Canary
var ok bool
if roll, ok = obj.(*rolloutv1.Canary); !ok {
if roll, ok = obj.(*flaggerv1.Canary); !ok {
logger.Errorf("Event Watch received an invalid object: %#v", obj)
return rolloutv1.Canary{}, false
return flaggerv1.Canary{}, false
}
return *roll, true
}

View File

@@ -5,14 +5,14 @@ import (
"time"
istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3"
rolloutv1 "github.com/stefanprodan/steerer/pkg/apis/rollout/v1beta1"
flaggerv1 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1beta1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
func (c *Controller) doRollouts() {
c.rollouts.Range(func(key interface{}, value interface{}) bool {
r := value.(*rolloutv1.Canary)
r := value.(*flaggerv1.Canary)
if r.Spec.TargetKind == "Deployment" {
go c.advanceDeploymentRollout(r.Name, r.Namespace)
}
@@ -135,8 +135,8 @@ func (c *Controller) advanceDeploymentRollout(name string, namespace string) {
}
}
func (c *Controller) getRollout(name string, namespace string) (*rolloutv1.Canary, bool) {
r, err := c.rolloutClient.SteererV1beta1().Canaries(namespace).Get(name, v1.GetOptions{})
func (c *Controller) getRollout(name string, namespace string) (*flaggerv1.Canary, bool) {
r, err := c.rolloutClient.FlaggerV1beta1().Canaries(namespace).Get(name, v1.GetOptions{})
if err != nil {
c.logger.Errorf("Canary %s.%s not found", name, namespace)
return nil, false
@@ -145,15 +145,15 @@ func (c *Controller) getRollout(name string, namespace string) (*rolloutv1.Canar
return r, true
}
func (c *Controller) checkRolloutStatus(r *rolloutv1.Canary, canary *appsv1.Deployment) bool {
func (c *Controller) checkRolloutStatus(r *flaggerv1.Canary, canary *appsv1.Deployment) bool {
var err error
if r.Status.State == "" {
r.Status = rolloutv1.CanaryStatus{
r.Status = flaggerv1.CanaryStatus{
State: "running",
CanaryRevision: canary.ResourceVersion,
FailedChecks: 0,
}
r, err = c.rolloutClient.SteererV1beta1().Canaries(r.Namespace).Update(r)
r, err = c.rolloutClient.FlaggerV1beta1().Canaries(r.Namespace).Update(r)
if err != nil {
c.logger.Errorf("Canary %s.%s status update failed: %v", r.Name, r.Namespace, err)
return false
@@ -188,12 +188,12 @@ func (c *Controller) checkRolloutStatus(r *rolloutv1.Canary, canary *appsv1.Depl
c.recordEventErrorf(r, "Scaling up %s.%s failed: %v", canary.GetName(), canary.Namespace, err)
return false
}
r.Status = rolloutv1.CanaryStatus{
r.Status = flaggerv1.CanaryStatus{
State: "running",
CanaryRevision: canary.ResourceVersion,
FailedChecks: 0,
}
r, err = c.rolloutClient.SteererV1beta1().Canaries(r.Namespace).Update(r)
r, err = c.rolloutClient.FlaggerV1beta1().Canaries(r.Namespace).Update(r)
if err != nil {
c.logger.Errorf("Canary %s.%s status update failed: %v", r.Name, r.Namespace, err)
return false
@@ -206,10 +206,10 @@ func (c *Controller) checkRolloutStatus(r *rolloutv1.Canary, canary *appsv1.Depl
return false
}
func (c *Controller) updateRolloutStatus(r *rolloutv1.Canary, status string) bool {
func (c *Controller) updateRolloutStatus(r *flaggerv1.Canary, status string) bool {
var err error
r.Status.State = status
r, err = c.rolloutClient.SteererV1beta1().Canaries(r.Namespace).Update(r)
r, err = c.rolloutClient.FlaggerV1beta1().Canaries(r.Namespace).Update(r)
if err != nil {
c.logger.Errorf("Canary %s.%s status update failed: %v", r.Name, r.Namespace, err)
return false
@@ -217,10 +217,10 @@ func (c *Controller) updateRolloutStatus(r *rolloutv1.Canary, status string) boo
return true
}
func (c *Controller) updateRolloutFailedChecks(r *rolloutv1.Canary, val int) bool {
func (c *Controller) updateRolloutFailedChecks(r *flaggerv1.Canary, val int) bool {
var err error
r.Status.FailedChecks = val
r, err = c.rolloutClient.SteererV1beta1().Canaries(r.Namespace).Update(r)
r, err = c.rolloutClient.FlaggerV1beta1().Canaries(r.Namespace).Update(r)
if err != nil {
c.logger.Errorf("Canary %s.%s status update failed: %v", r.Name, r.Namespace, err)
return false
@@ -228,7 +228,7 @@ func (c *Controller) updateRolloutFailedChecks(r *rolloutv1.Canary, val int) boo
return true
}
func (c *Controller) getDeployment(r *rolloutv1.Canary, name string, namespace string) (*appsv1.Deployment, bool) {
func (c *Controller) getDeployment(r *flaggerv1.Canary, name string, namespace string) (*appsv1.Deployment, bool) {
dep, err := c.kubeClient.AppsV1().Deployments(namespace).Get(name, v1.GetOptions{})
if err != nil {
c.recordEventErrorf(r, "Deployment %s.%s not found", name, namespace)
@@ -247,7 +247,7 @@ func (c *Controller) getDeployment(r *rolloutv1.Canary, name string, namespace s
return dep, true
}
func (c *Controller) getCanaryDeployment(r *rolloutv1.Canary, name string, namespace string) (*appsv1.Deployment, bool) {
func (c *Controller) getCanaryDeployment(r *flaggerv1.Canary, name string, namespace string) (*appsv1.Deployment, bool) {
dep, err := c.kubeClient.AppsV1().Deployments(namespace).Get(name, v1.GetOptions{})
if err != nil {
c.recordEventErrorf(r, "Deployment %s.%s not found", name, namespace)
@@ -272,7 +272,7 @@ func (c *Controller) getDeploymentRevision(name string, namespace string) string
return dep.ResourceVersion
}
func (c *Controller) checkDeploymentMetrics(r *rolloutv1.Canary) bool {
func (c *Controller) checkDeploymentMetrics(r *flaggerv1.Canary) bool {
for _, metric := range r.Spec.CanaryAnalysis.Metrics {
if metric.Name == "istio_requests_total" {
val, err := c.getDeploymentCounter(r.Spec.Canary.Name, r.Namespace, metric.Name, metric.Interval)
@@ -305,7 +305,7 @@ func (c *Controller) checkDeploymentMetrics(r *rolloutv1.Canary) bool {
return true
}
func (c *Controller) scaleToZeroCanary(r *rolloutv1.Canary) {
func (c *Controller) scaleToZeroCanary(r *flaggerv1.Canary) {
canary, err := c.kubeClient.AppsV1().Deployments(r.Namespace).Get(r.Spec.Canary.Name, v1.GetOptions{})
if err != nil {
c.recordEventErrorf(r, "Deployment %s.%s not found", r.Spec.Canary.Name, r.Namespace)
@@ -320,25 +320,25 @@ func (c *Controller) scaleToZeroCanary(r *rolloutv1.Canary) {
}
}
func (c *Controller) setCanaryRevision(r *rolloutv1.Canary, status string) {
func (c *Controller) setCanaryRevision(r *flaggerv1.Canary, status string) {
canaryRevision := c.getDeploymentRevision(r.Spec.Canary.Name, r.Namespace)
r, ok := c.getRollout(r.Name, r.Namespace)
if !ok {
return
}
r.Status = rolloutv1.CanaryStatus{
r.Status = flaggerv1.CanaryStatus{
State: status,
CanaryRevision: canaryRevision,
FailedChecks: r.Status.FailedChecks,
}
r, err := c.rolloutClient.SteererV1beta1().Canaries(r.Namespace).Update(r)
r, err := c.rolloutClient.FlaggerV1beta1().Canaries(r.Namespace).Update(r)
if err != nil {
c.logger.Errorf("Canary %s.%s status update failed: %v", r.Name, r.Namespace, err)
}
//c.logger.Infof("Canary %s.%s status %+v", r.Spec.Canary.Name, r.Namespace, r.Status)
}
func (c *Controller) getVirtualService(r *rolloutv1.Canary) (
func (c *Controller) getVirtualService(r *flaggerv1.Canary) (
vs *istiov1alpha3.VirtualService,
primary istiov1alpha3.DestinationWeight,
canary istiov1alpha3.DestinationWeight,
@@ -373,7 +373,7 @@ func (c *Controller) getVirtualService(r *rolloutv1.Canary) (
}
func (c *Controller) updateVirtualServiceRoutes(
r *rolloutv1.Canary,
r *flaggerv1.Canary,
vs *istiov1alpha3.VirtualService,
primary istiov1alpha3.DestinationWeight,
canary istiov1alpha3.DestinationWeight,

View File

@@ -1,4 +1,4 @@
package version
var VERSION = "0.0.1-rc.23"
var VERSION = "0.0.1"
var REVISION = "unknown"