diff --git a/README.md b/README.md index e98ec02a..4c7cfa3a 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,10 @@ spec: kind: HorizontalPodAutoscaler name: podinfo service: - # container port + # ClusterIP port number port: 9898 + # container port name or number (optional) + targetPort: 9898 # port name can be http or grpc (default http) portName: http # HTTP match conditions (optional) diff --git a/artifacts/canaries/deployment.yaml b/artifacts/canaries/deployment.yaml index fe2043ea..602fd477 100644 --- a/artifacts/canaries/deployment.yaml +++ b/artifacts/canaries/deployment.yaml @@ -20,12 +20,13 @@ spec: metadata: annotations: prometheus.io/scrape: "true" + prometheus.io/port: "9898" labels: app: podinfo spec: containers: - name: podinfod - image: stefanprodan/podinfo:2.0.0 + image: stefanprodan/podinfo:3.1.0 imagePullPolicy: IfNotPresent ports: - containerPort: 9898 diff --git a/docs/gitbook/faq.md b/docs/gitbook/faq.md index 1db364e1..01089ce0 100644 --- a/docs/gitbook/faq.md +++ b/docs/gitbook/faq.md @@ -158,8 +158,10 @@ spec: kind: Deployment name: podinfo service: - # container port (required) + # ClusterIP port number (required) port: 9898 + # container port name or number + targetPort: http # port name can be http or grpc (default http) portName: http ``` diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index afd5e239..fda9db56 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -32,10 +32,12 @@ spec: kind: HorizontalPodAutoscaler name: podinfo service: - # container port + # ClusterIP port number port: 9898 - # port name can be http or grpc (default http) + # ClusterIP port name can be http or grpc (default http) portName: http + # container port number or name (optional) + targetPort: 9898 # add all the other container ports # to the ClusterIP services (default false) portDiscovery: false @@ -95,7 +97,7 @@ Besides `app` Flagger supports `name` and `app.kubernetes.io/name` selectors. If convention you can specify your label with the `-selector-labels` flag. The target deployment should expose a TCP port that will be used by Flagger to create the ClusterIP Services. -The container port from the target deployment should match the `service.port` value. +The container port from the target deployment should match the `service.port` or `service.targetPort`. ### Canary status diff --git a/docs/gitbook/usage/ab-testing.md b/docs/gitbook/usage/ab-testing.md index d79207a6..587e84b0 100644 --- a/docs/gitbook/usage/ab-testing.md +++ b/docs/gitbook/usage/ab-testing.md @@ -131,7 +131,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/abtest \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: diff --git a/docs/gitbook/usage/blue-green.md b/docs/gitbook/usage/blue-green.md index 8702735a..e4ed2209 100644 --- a/docs/gitbook/usage/blue-green.md +++ b/docs/gitbook/usage/blue-green.md @@ -80,7 +80,6 @@ metadata: namespace: test spec: # service mesh provider can be: kubernetes, istio, appmesh, nginx, gloo - # use the kubernetes provider for Blue/Green style deployments provider: kubernetes # deployment reference targetRef: @@ -96,7 +95,6 @@ spec: kind: HorizontalPodAutoscaler name: podinfo service: - # container port port: 9898 portDiscovery: true canaryAnalysis: @@ -172,7 +170,7 @@ Trigger a deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: @@ -297,7 +295,7 @@ Trigger a deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.3 +podinfod=stefanprodan/podinfo:3.1.3 ``` Generate 404s: diff --git a/docs/gitbook/usage/gloo-progressive-delivery.md b/docs/gitbook/usage/gloo-progressive-delivery.md index 3c5018d7..994fba73 100644 --- a/docs/gitbook/usage/gloo-progressive-delivery.md +++ b/docs/gitbook/usage/gloo-progressive-delivery.md @@ -118,8 +118,10 @@ spec: # to make progress before it is rollback (default 600s) progressDeadlineSeconds: 60 service: - # container port + # ClusterIP port number port: 9898 + # container port number or name (optional) + targetPort: 9898 canaryAnalysis: # schedule interval (default 60s) interval: 10s @@ -198,7 +200,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: @@ -252,7 +254,7 @@ Trigger another canary deployment: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.2 +podinfod=stefanprodan/podinfo:3.1.2 ``` Generate HTTP 500 errors: @@ -335,7 +337,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.3 +podinfod=stefanprodan/podinfo:3.1.3 ``` Generate 404s: diff --git a/docs/gitbook/usage/linkerd-progressive-delivery.md b/docs/gitbook/usage/linkerd-progressive-delivery.md index 815b4856..2bdb4fe2 100644 --- a/docs/gitbook/usage/linkerd-progressive-delivery.md +++ b/docs/gitbook/usage/linkerd-progressive-delivery.md @@ -67,8 +67,10 @@ spec: # to make progress before it is rollback (default 600s) progressDeadlineSeconds: 60 service: - # container port + # ClusterIP port number port: 9898 + # container port number or name (optional) + targetPort: 9898 canaryAnalysis: # schedule interval (default 60s) interval: 30s @@ -150,7 +152,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: @@ -208,7 +210,7 @@ Trigger another canary deployment: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.2 +podinfod=stefanprodan/podinfo:3.1.2 ``` Exec into the load tester pod with: @@ -297,7 +299,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.3 +podinfod=stefanprodan/podinfo:3.1.3 ``` Generate 404s: @@ -444,7 +446,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.4 +podinfod=stefanprodan/podinfo:3.1.4 ``` Flagger detects that the deployment revision changed and starts the A/B testing: diff --git a/docs/gitbook/usage/nginx-progressive-delivery.md b/docs/gitbook/usage/nginx-progressive-delivery.md index 2772850f..8426248c 100644 --- a/docs/gitbook/usage/nginx-progressive-delivery.md +++ b/docs/gitbook/usage/nginx-progressive-delivery.md @@ -86,7 +86,7 @@ spec: paths: - backend: serviceName: podinfo - servicePort: 9898 + servicePort: 80 ``` Save the above resource as podinfo-ingress.yaml and then apply it: @@ -124,8 +124,10 @@ spec: # to make progress before it is rollback (default 600s) progressDeadlineSeconds: 60 service: - # container port - port: 9898 + # ClusterIP port number + port: 80 + # container port number or name + targetPort: 9898 canaryAnalysis: # schedule interval (default 60s) interval: 10s @@ -144,8 +146,15 @@ spec: # percentage (0-100) threshold: 99 interval: 1m - # load testing (optional) + # testing (optional) webhooks: + - name: acceptance-test + type: pre-rollout + url: http://flagger-loadtester.test/ + timeout: 30s + metadata: + type: bash + cmd: "curl -sd 'test' http://podinfo-canary/token | grep token" - name: load-test url: http://flagger-loadtester.test/ timeout: 5s @@ -190,7 +199,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: @@ -244,7 +253,7 @@ Trigger another canary deployment: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.2 +podinfod=stefanprodan/podinfo:3.1.2 ``` Generate HTTP 500 errors: @@ -314,7 +323,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.3 +podinfod=stefanprodan/podinfo:3.1.3 ``` Generate high response latency: @@ -388,7 +397,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.4 +podinfod=stefanprodan/podinfo:3.1.4 ``` Flagger detects that the deployment revision changed and starts the A/B testing: @@ -419,4 +428,3 @@ Events: Warning Synced 15s flagger Waiting for podinfo-primary.test rollout to finish: 1 of 2 updated replicas are available Normal Synced 5s flagger Promotion completed! Scaling down podinfo.test ``` - diff --git a/docs/gitbook/usage/progressive-delivery.md b/docs/gitbook/usage/progressive-delivery.md index 17d3c4fe..698e4119 100644 --- a/docs/gitbook/usage/progressive-delivery.md +++ b/docs/gitbook/usage/progressive-delivery.md @@ -55,8 +55,10 @@ spec: kind: HorizontalPodAutoscaler name: podinfo service: - # container port + # service port number port: 9898 + # container port number or name (optional) + targetPort: 9898 # Istio gateways (optional) gateways: - public-gateway.istio-system.svc.cluster.local @@ -142,7 +144,7 @@ Trigger a canary deployment by updating the container image: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.1 +podinfod=stefanprodan/podinfo:3.1.1 ``` Flagger detects that the deployment revision changed and starts a new rollout: @@ -201,7 +203,7 @@ Trigger another canary deployment: ```bash kubectl -n test set image deployment/podinfo \ -podinfod=stefanprodan/podinfo:2.0.2 +podinfod=stefanprodan/podinfo:3.1.2 ``` Exec into the load tester pod with: