Flagger
Search…
Flagger Install on Alibaba ServiceMesh
This guide walks you through setting up Flagger on Alibaba ServiceMesh.

Prerequisites

Variables declaration

Install Prometheus

Install Prometheus:
1
kubectl apply -f $ISTIO_RELEASE/samples/addons/prometheus.yaml
Copied!
it' same with the below cmd:
1
kubectl --kubeconfig "$ACK_CONFIG" apply -f $ISTIO_RELEASE/samples/addons/prometheus.yaml
Copied!
Append the below configs to scrape_configs in prometheus configmap, to support telemetry:
1
scrape_configs:
2
# Mixer scrapping. Defaults to Prometheus and mixer on same namespace.
3
- job_name: 'istio-mesh'
4
kubernetes_sd_configs:
5
- role: endpoints
6
namespaces:
7
names:
8
- istio-system
9
relabel_configs:
10
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
11
action: keep
12
regex: istio-telemetry;prometheus
13
# Scrape config for envoy stats
14
- job_name: 'envoy-stats'
15
metrics_path: /stats/prometheus
16
kubernetes_sd_configs:
17
- role: pod
18
relabel_configs:
19
- source_labels: [__meta_kubernetes_pod_container_port_name]
20
action: keep
21
regex: '.*-envoy-prom'
22
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
23
action: replace
24
regex: ([^:]+)(?::\d+)?;(\d+)
25
replacement: $1:15090
26
target_label: __address__
27
- action: labeldrop
28
regex: __meta_kubernetes_pod_label_(.+)
29
- source_labels: [__meta_kubernetes_namespace]
30
action: replace
31
target_label: namespace
32
- source_labels: [__meta_kubernetes_pod_name]
33
action: replace
34
target_label: pod_name
35
- job_name: 'istio-policy'
36
kubernetes_sd_configs:
37
- role: endpoints
38
namespaces:
39
names:
40
- istio-system
41
relabel_configs:
42
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
43
action: keep
44
regex: istio-policy;http-policy-monitoring
45
- job_name: 'istio-telemetry'
46
kubernetes_sd_configs:
47
- role: endpoints
48
namespaces:
49
names:
50
- istio-system
51
relabel_configs:
52
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
53
action: keep
54
regex: istio-telemetry;http-monitoring
55
- job_name: 'pilot'
56
kubernetes_sd_configs:
57
- role: endpoints
58
namespaces:
59
names:
60
- istio-system
61
relabel_configs:
62
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
63
action: keep
64
regex: istiod;http-monitoring
65
- source_labels: [__meta_kubernetes_service_label_app]
66
target_label: app
67
- job_name: 'sidecar-injector'
68
kubernetes_sd_configs:
69
- role: endpoints
70
namespaces:
71
names:
72
- istio-system
73
relabel_configs:
74
- source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
75
action: keep
76
regex: istio-sidecar-injector;http-monitoring
Copied!

Install Flagger

Add Flagger Helm repository:
1
helm repo add flagger https://flagger.app
2
helm repo update
Copied!
Install Flagger's Canary CRD:
1
kubectl apply -f $FLAGGER_SRC/artifacts/flagger/crd.yaml
Copied!
Deploy Flagger for Alibaba ServiceMesh:
1
cp $MESH_CONFIG kubeconfig
2
kubectl -n istio-system create secret generic istio-kubeconfig --from-file kubeconfig
3
kubectl -n istio-system label secret istio-kubeconfig istio/multiCluster=true
4
helm upgrade -i flagger flagger/flagger \
5
--namespace=istio-system \
6
--set crd.create=false \
7
--set meshProvider=istio \
8
--set metricsServer=http://prometheus:9090 \
9
--set istio.kubeconfig.secretName=istio-kubeconfig \
10
--set istio.kubeconfig.key=kubeconfig
Copied!
Last modified 9mo ago