diff --git a/docs/content/en/docs/fleet-manager/rollout/abtest.md b/docs/content/en/docs/fleet-manager/rollout/abtest.md index 81f9a6fc..62886800 100644 --- a/docs/content/en/docs/fleet-manager/rollout/abtest.md +++ b/docs/content/en/docs/fleet-manager/rollout/abtest.md @@ -55,7 +55,7 @@ istio-system istio-ingressgateway-65b5c9f9bb-8w5ml 1/1 istio-system istiod-657f7686cf-hshwp 1/1 Running 0 2m5s ``` -### Prometheus +#### Prometheus Kurator needs to use Prometheus to collect metrics on monitored resources in the cluster, which will be used as the basis for determining whether to continue rolling out. @@ -75,7 +75,7 @@ istio-system prometheus-5d5d6d6fc-5hxbh 2/2 Notes: It is recommended to change the release in the above commands to match the version of Istio that was already installed. -### Ingress Gateway +#### Ingress Gateway To allow external programs access to the services you've deployed, you will need to create an IngressGateway resource. @@ -109,6 +109,21 @@ kubectl get gateway -n istio-system --kubeconfig=/root/.kube/kurator-member1.con istio-system public-gateway 17s ``` +### Nginx + +When Nginx is specified in fleet's `rollout.trafficRoutingProvider` , Kurator will install Nginx and its supporting Prometheus via helm in the fleet-managed clusters. + +You can review the results a few minutes after applying fleet: +```console +kubectl get po -n ingress-nginx --kubeconfig=/root/.kube/kurator-member1.config +NAME READY STATUS RESTARTS AGE +ingress-nginx-flagger-kurator-member-7fbdfb7f7-hphc2 1/1 Running 0 5m44s +ingress-nginx-flagger-kurator-member-prometheus-56bdbf4855l4jkx 1/1 Running 0 5m44s +ingress-nginx-nginx-kurator-member-controller-6566b7886-b7g8f 1/1 Running 0 5m33s +ingress-nginx-testloader-kurator-member-loadtester-7ff7d75l2dwj 1/1 Running 0 5m51s + +``` + ### Kurator Rollout Plugin Before delving into the how to Perform a Unified Rollout, ensure you have successfully installed the Rollout plugin as outlined in the [Rollout plugin installation guide](/docs/fleet-manager/rollout/rollout-plugin/). @@ -331,6 +346,104 @@ If the status shows as `Initialized`, it means the initialization of rollout pro **Notes**: In the above configuration, we set the `kustomization.interval` to 0s. This disables Fluxcd's periodic synchronization of configurations between the local mirror and cluster. The reason is that Flagger needs to modify the replica counts in Deployments to complete its initialization process. If you are uncertain whether the replicas for all applications in your deployments are set to zero, it is recommended to also set `kustomization.interval` to 0s. +### Using Nginx +You can deploy a abtest application demo using Nginx by the following command: + +```console +kubectl apply -f examples/rollout/ab-testingNginx.yaml +``` + +Here is the configuration: +```yaml +apiVersion: apps.kurator.dev/v1alpha1 +kind: Application +metadata: + name: abtesting-nginx-demo + namespace: default +spec: + source: + gitRepository: + interval: 3m0s + ref: + branch: master + timeout: 1m0s + url: https://github.com/stefanprodan/podinfo + syncPolicies: + - destination: + fleet: quickstart + kustomization: + interval: 0s + path: ./deploy/webapp + prune: true + timeout: 2m0s + rollout: + testLoader: true + trafficRoutingProvider: nginx + workload: + apiVersion: apps/v1 + name: backend + kind: Deployment + namespace: webapp + serviceName: backend + port: 9898 + rolloutPolicy: + trafficRouting: + analysisTimes: 3 + timeoutSeconds: 60 + host: "app.example.com" + match: + - headers: + x-canary: + exact: "insider" + - headers: + cookie: + exact: "canary" + trafficAnalysis: + checkIntervalSeconds: 90 + checkFailedTimes: 2 + metrics: + - name: nginx-request-success-rate + intervalSeconds: 90 + thresholdRange: + min: 99 + customMetric: + provider: + type: prometheus + address: http://ingress-nginx-flagger-kurator-member-prometheus.ingress-nginx:9090 + query: | + sum( + rate( + http_requests_total{ + status!~"5.*" + }[{{ interval }}] + ) + ) + / + sum( + rate( + http_requests_total[{{ interval }}] + ) + ) * 100 + webhooks: + timeoutSeconds: 60 + command: + - "hey -z 1m -q 10 -c 2 http://app.example.com/" + rolloutTimeoutSeconds: 600 + - destination: + fleet: quickstart + kustomization: + targetNamespace: default + interval: 5m0s + path: ./kustomize + prune: true + timeout: 2m0s +``` + +To use Nginx, you need to provide the `host` it uses. Kurator will generate an ingress resource based on this field. Here is the [specific configuration generated](/docs/references/app-api/#apps.kurator.dev/v1alpha1.TrafficRoutingConfig). +. Other configurations are the same as above. + +**Notes:**There is a problem with the metric provided by the current flagger, so `customMetric` is used.Here is the detailed [API](/docs/references/app-api/#apps.kurator.dev/v1alpha1.Metric). + ### Trigger Rollout An A/B Testing can be triggered by either updating the container image referenced in the git repository configuration, or directly updating the image of the deployment resource locally in the Kubernetes cluster. diff --git a/docs/content/en/docs/fleet-manager/rollout/blue-green.md b/docs/content/en/docs/fleet-manager/rollout/blue-green.md index c8af9942..f2e35ae6 100644 --- a/docs/content/en/docs/fleet-manager/rollout/blue-green.md +++ b/docs/content/en/docs/fleet-manager/rollout/blue-green.md @@ -55,7 +55,7 @@ istio-system istio-ingressgateway-65b5c9f9bb-8w5ml 1/1 istio-system istiod-657f7686cf-hshwp 1/1 Running 0 2m5s ``` -### Prometheus +#### Prometheus Kurator needs to use Prometheus to collect metrics on monitored resources in the cluster, which will be used as the basis for determining whether to continue rolling out. @@ -75,7 +75,7 @@ istio-system prometheus-5d5d6d6fc-5hxbh 2/2 Notes: It is recommended to change the release in the above commands to match the version of Istio that was already installed. -### Ingress Gateway +#### Ingress Gateway To allow external programs access to the services you've deployed, you will need to create an IngressGateway resource. @@ -109,6 +109,21 @@ kubectl get gateway -n istio-system --kubeconfig=/root/.kube/kurator-member1.con istio-system public-gateway 17s ``` +### Nginx + +When Nginx is specified in fleet's `rollout.trafficRoutingProvider` , Kurator will install Nginx and its supporting Prometheus via helm in the fleet-managed clusters. + +You can review the results a few minutes after applying fleet: +```console +kubectl get po -n ingress-nginx --kubeconfig=/root/.kube/kurator-member1.config +NAME READY STATUS RESTARTS AGE +ingress-nginx-flagger-kurator-member-7fbdfb7f7-hphc2 1/1 Running 0 5m44s +ingress-nginx-flagger-kurator-member-prometheus-56bdbf4855l4jkx 1/1 Running 0 5m44s +ingress-nginx-nginx-kurator-member-controller-6566b7886-b7g8f 1/1 Running 0 5m33s +ingress-nginx-testloader-kurator-member-loadtester-7ff7d75l2dwj 1/1 Running 0 5m51s + +``` + ### Kurator Rollout Plugin Before delving into the how to Perform a Unified Rollout, ensure you have successfully installed the Rollout plugin as outlined in the [Rollout plugin installation guide](/docs/fleet-manager/rollout/rollout-plugin/). @@ -323,6 +338,98 @@ If the status shows as `Initialized`, it means the initialization of rollout pro **Notes**: In the above configuration, we set the `kustomization.interval` to 0s. This disables Fluxcd's periodic synchronization of configurations between the local mirror and cluster. The reason is that Flagger needs to modify the replica counts in Deployments to complete its initialization process. If you are uncertain whether the replicas for all applications in your deployments are set to zero, it is recommended to also set `kustomization.interval` to 0s. +### Using Nginx +You can deploy a blue-green application demo using Nginx by the following command: + +```console +kubectl apply -f examples/rollout/blue_greenNginx.yaml +``` + +Here is the configuration: +```yaml +apiVersion: apps.kurator.dev/v1alpha1 +kind: Application +metadata: + name: blue-green-nginx-demo + namespace: default +spec: + source: + gitRepository: + interval: 3m0s + ref: + branch: master + timeout: 1m0s + url: https://github.com/stefanprodan/podinfo + syncPolicies: + - destination: + fleet: quickstart + kustomization: + interval: 0s + path: ./deploy/webapp + prune: true + timeout: 2m0s + rollout: + testLoader: true + trafficRoutingProvider: nginx + workload: + apiVersion: apps/v1 + name: backend + kind: Deployment + namespace: webapp + serviceName: backend + port: 9898 + rolloutPolicy: + trafficRouting: + analysisTimes: 3 + timeoutSeconds: 60 + host: "app.example.com" + trafficAnalysis: + checkIntervalSeconds: 90 + checkFailedTimes: 2 + metrics: + - name: nginx-request-success-rate + intervalSeconds: 90 + thresholdRange: + min: 99 + customMetric: + provider: + type: prometheus + address: http://ingress-nginx-flagger-kurator-member-prometheus.ingress-nginx:9090 + query: | + sum( + rate( + http_requests_total{ + status!~"5.*" + }[{{ interval }}] + ) + ) + / + sum( + rate( + http_requests_total[{{ interval }}] + ) + ) * 100 + webhooks: + timeoutSeconds: 60 + command: + - "hey -z 1m -q 10 -c 2 http://app.example.com/" + rolloutTimeoutSeconds: 600 + - destination: + fleet: quickstart + kustomization: + targetNamespace: default + interval: 5m0s + path: ./kustomize + prune: true + timeout: 2m0s +``` + +To use Nginx, you need to provide the `host` it uses. Kurator will generate an ingress resource based on this field. Here is the [specific configuration generated](/docs/references/app-api/#apps.kurator.dev/v1alpha1.TrafficRoutingConfig). +. Other configurations are the same as above. + +**Notes:**There is a problem with the metric provided by the current flagger, so `customMetric` is used.Here is the detailed [API](/docs/references/app-api/#apps.kurator.dev/v1alpha1.Metric). + + ### Trigger Rollout #### Automated Rollout diff --git a/docs/content/en/docs/fleet-manager/rollout/canary.md b/docs/content/en/docs/fleet-manager/rollout/canary.md index 1407c265..f5913fcb 100644 --- a/docs/content/en/docs/fleet-manager/rollout/canary.md +++ b/docs/content/en/docs/fleet-manager/rollout/canary.md @@ -55,7 +55,7 @@ istio-system istio-ingressgateway-65b5c9f9bb-8w5ml 1/1 istio-system istiod-657f7686cf-hshwp 1/1 Running 0 2m5s ``` -### Prometheus +#### Prometheus Kurator needs to use Prometheus to collect metrics on monitored resources in the cluster, which will be used as the basis for determining whether to continue rolling out. @@ -75,7 +75,7 @@ istio-system prometheus-5d5d6d6fc-5hxbh 2/2 Notes: It is recommended to change the release in the above commands to match the version of Istio that was already installed. -### Ingress Gateway +#### Ingress Gateway To allow external programs access to the services you've deployed, you will need to create an IngressGateway resource. @@ -109,6 +109,85 @@ kubectl get gateway -n istio-system --kubeconfig=/root/.kube/kurator-member1.con istio-system public-gateway 17s ``` +### Kuma +When Kuma is specified in fleet's `rollout.trafficRoutingProvider` , Kurator will install Kuma via helm in the fleet-managed clusters. + +You can review the results a few minutes after applying fleet: +```console +kubectl get po -n kuma-system --kubeconfig=/root/.kube/kurator-member1.config +NAME READY STATUS RESTARTS AGE +kuma-control-plane-748fbfd949-27nnk 1/1 Running 0 80s +kuma-system-flagger-kurator-member-5cd65cdc48-srqmt 1/1 Running 0 5m5s +kuma-system-testloader-kurator-member-loadtester-7ff7d757bh5m4k 1/1 Running 0 5m5s + + +#### Prometheus + +You can install Prometheus paired with Kuma using the following commands: + +```console +export KUBECONFIG=/root/.kube/kurator-member1.config +kumactl install observability --components "prometheus" | kubectl apply -f - +``` +**Note:**Refer to [kuma documentation](https://docs.konghq.com/mesh/latest/production/install-kumactl/) for instructions on installing kumactl. + +Review the results: + +```console +kubectl get po -n mesh-observability --kubeconfig=/root/.kube/kurator-member1.config +NAME READY STATUS RESTARTS AGE +prometheus-kube-state-metrics-56b6556878-p4dj4 1/1 Running 0 5m2s +prometheus-server-7f4ddbb69-swz4w 3/3 Running 0 5m2s +``` + +#### Mesh + +To allow external programs access to the services you've deployed, you will need to create an Mesh resource. + +You can create an mesh using the following commands: + +```console +kubectl apply -f -<