diff --git a/applications/istio-addons/kustomization.yaml b/applications/istio-addons/kustomization.yaml new file mode 100644 index 0000000..18abbb9 --- /dev/null +++ b/applications/istio-addons/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - grafana.yaml + - jaeger.yaml + - kiali.yaml + - loki.yaml + - prometheus-operator.yaml + - skywalking.yaml + - zipkin.yaml diff --git a/applications/istio-addons/prometheus-operator.yaml b/applications/istio-addons/prometheus-operator.yaml new file mode 100644 index 0000000..73a926e --- /dev/null +++ b/applications/istio-addons/prometheus-operator.yaml @@ -0,0 +1,66 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: envoy-stats-monitor + namespace: istio-system + labels: + monitoring: istio-proxies + release: istio +spec: + selector: + matchExpressions: + - {key: istio-prometheus-ignore, operator: DoesNotExist} + namespaceSelector: + any: true + jobLabel: envoy-stats + podMetricsEndpoints: + - path: /stats/prometheus + interval: 15s + relabelings: + - action: keep + sourceLabels: [__meta_kubernetes_pod_container_name] + regex: "istio-proxy" + - action: keep + sourceLabels: [__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape] + - action: replace + regex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}) + replacement: '[$2]:$1' + sourceLabels: + - __meta_kubernetes_pod_annotation_prometheus_io_port + - __meta_kubernetes_pod_ip + targetLabel: __address__ + - action: replace + regex: (\d+);((([0-9]+?)(\.|$)){4}) + replacement: $2:$1 + sourceLabels: + - __meta_kubernetes_pod_annotation_prometheus_io_port + - __meta_kubernetes_pod_ip + targetLabel: __address__ + - action: labeldrop + regex: "__meta_kubernetes_pod_label_(.+)" + - sourceLabels: [__meta_kubernetes_namespace] + action: replace + targetLabel: namespace + - sourceLabels: [__meta_kubernetes_pod_name] + action: replace + targetLabel: pod_name +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: istio-component-monitor + namespace: istio-system + labels: + monitoring: istio-components + release: istio +spec: + jobLabel: istio + targetLabels: [app] + selector: + matchExpressions: + - {key: istio, operator: In, values: [pilot]} + namespaceSelector: + any: true + endpoints: + - port: http-monitoring + interval: 15s diff --git a/applications/istio-addons/skywalking.yaml b/applications/istio-addons/skywalking.yaml new file mode 100644 index 0000000..2bc0c4d --- /dev/null +++ b/applications/istio-addons/skywalking.yaml @@ -0,0 +1,133 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: skywalking-oap + namespace: istio-system + labels: + app: skywalking-oap +spec: + selector: + matchLabels: + app: skywalking-oap + template: + metadata: + labels: + app: skywalking-oap + sidecar.istio.io/inject: "false" + spec: + containers: + - name: skywalking-oap + image: apache/skywalking-oap-server:9.7.0 + env: + - name: SW_HEALTH_CHECKER + value: default + readinessProbe: + exec: + command: + - /skywalking/bin/swctl + - health + initialDelaySeconds: 30 + periodSeconds: 5 + +--- +apiVersion: v1 +kind: Service +metadata: + name: tracing + namespace: istio-system + labels: + app: skywalking-oap +spec: + type: ClusterIP + ports: + - name: grpc + port: 11800 + protocol: TCP + targetPort: 11800 + - name: http-query + port: 12800 + protocol: TCP + targetPort: 12800 + selector: + app: skywalking-oap +--- +apiVersion: v1 +kind: Service +metadata: + labels: + name: skywalking-oap + name: skywalking-oap + namespace: istio-system +spec: + ports: + - port: 11800 + targetPort: 11800 + name: grpc + - port: 12800 + targetPort: 12800 + name: http-query + selector: + app: skywalking-oap +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: skywalking-ui + namespace: istio-system + labels: + app: skywalking-ui +spec: + selector: + matchLabels: + app: skywalking-ui + template: + metadata: + labels: + app: skywalking-ui + annotations: + sidecar.istio.io/inject: "false" + spec: + containers: + - name: skywalking-ui + image: apache/skywalking-ui:9.1.0 + env: + - name: SW_OAP_ADDRESS + value: http://skywalking-oap:12800 + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 5 +--- +apiVersion: v1 +kind: Service +metadata: + name: tracing-ui + namespace: istio-system + labels: + app: skywalking-ui +spec: + type: ClusterIP + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: skywalking-ui +--- +apiVersion: v1 +kind: Service +metadata: + labels: + name: skywalking-ui + name: skywalking-ui + namespace: istio-system +spec: + ports: + - port: 8080 + targetPort: 8080 + name: http + selector: + app: skywalking-ui diff --git a/applications/istio-addons/zipkin.yaml b/applications/istio-addons/zipkin.yaml new file mode 100644 index 0000000..d1abdd8 --- /dev/null +++ b/applications/istio-addons/zipkin.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: zipkin + namespace: istio-system + labels: + app: zipkin +spec: + selector: + matchLabels: + app: zipkin + template: + metadata: + labels: + app: zipkin + sidecar.istio.io/inject: "false" + spec: + containers: + - name: zipkin + image: openzipkin/zipkin-slim:3.1.1 + env: + - name: STORAGE_METHOD + value: "mem" + readinessProbe: + httpGet: + path: /health + port: 9411 + initialDelaySeconds: 5 + periodSeconds: 5 +--- +apiVersion: v1 +kind: Service +metadata: + name: tracing + namespace: istio-system + labels: + app: zipkin +spec: + type: ClusterIP + ports: + - name: http-query + port: 80 + protocol: TCP + targetPort: 9411 + selector: + app: zipkin +--- +apiVersion: v1 +kind: Service +metadata: + labels: + name: zipkin + name: zipkin + namespace: istio-system +spec: + ports: + - port: 9411 + targetPort: 9411 + name: http-query + selector: + app: zipkin diff --git a/clusters/local/istio-addons.yaml b/clusters/local/istio-addons.yaml new file mode 100644 index 0000000..ee1bcad --- /dev/null +++ b/clusters/local/istio-addons.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: istio-addons + namespace: flux-system +spec: + interval: 1m + path: ./applications/istio-addons + prune: true + dependsOn: + - name: istio + namespace: flux-system + sourceRef: + kind: GitRepository + name: flux-system + namespace: flux-system