this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(istio): add monitoring addons back

Change-Id: I2d5011ef621ebfe6f04cffe08b460bcaa30c37ee

Khue Doan 478fc6c0 ff2dccfb

+145
+145
infra/.modules/bootstrap/istio.tf
··· 123 123 } 124 124 }) 125 125 } 126 + 127 + resource "kubectl_manifest" "istio_addons" { 128 + server_side_apply = true 129 + yaml_body = yamlencode({ 130 + apiVersion = "argoproj.io/v1alpha1" 131 + kind = "Application" 132 + metadata = { 133 + name = "istio-addons" 134 + namespace = helm_release.argocd.namespace 135 + finalizers = ["resources-finalizer.argocd.argoproj.io"] 136 + labels = local.common_labels 137 + } 138 + spec = { 139 + project = "default" 140 + destination = { 141 + name = "in-cluster" 142 + namespace = "istio-system" 143 + } 144 + syncPolicy = local.sync_policy 145 + source = { 146 + repoURL = "https://bjw-s-labs.github.io/helm-charts" 147 + chart = "app-template" 148 + targetRevision = "3.7.3" 149 + helm = { 150 + valuesObject = { 151 + rawResources = { 152 + # From https://github.com/istio/istio/blob/master/samples/addons/extras/prometheus-operator.yaml 153 + component-monitor = { 154 + apiVersion = "monitoring.coreos.com/v1" 155 + kind = "ServiceMonitor" 156 + spec = { 157 + spec = { 158 + endpoints = [ 159 + { 160 + interval = "15s" 161 + port = "http-monitoring" 162 + }, 163 + ] 164 + jobLabel = "istio" 165 + namespaceSelector = { 166 + "any" = true 167 + } 168 + selector = { 169 + matchExpressions = [ 170 + { 171 + key = "istio" 172 + operator = "In" 173 + values = [ 174 + "pilot", 175 + ] 176 + }, 177 + ] 178 + } 179 + targetLabels = [ 180 + "app", 181 + ] 182 + } 183 + } 184 + } 185 + envoy-stats-monitor = { 186 + apiVersion = "monitoring.coreos.com/v1" 187 + kind = "PodMonitor" 188 + spec = { 189 + spec = { 190 + jobLabel = "envoy-stats" 191 + namespaceSelector = { 192 + "any" = true 193 + } 194 + podMetricsEndpoints = [ 195 + { 196 + interval = "15s" 197 + path = "/stats/prometheus" 198 + relabelings = [ 199 + { 200 + action = "keep" 201 + regex = "istio-proxy" 202 + sourceLabels = [ 203 + "__meta_kubernetes_pod_container_name", 204 + ] 205 + }, 206 + { 207 + action = "keep" 208 + sourceLabels = [ 209 + "__meta_kubernetes_pod_annotationpresent_prometheus_io_scrape", 210 + ] 211 + }, 212 + { 213 + action = "replace" 214 + regex = "(\\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})" 215 + replacement = "[$2]:$1" 216 + sourceLabels = [ 217 + "__meta_kubernetes_pod_annotation_prometheus_io_port", 218 + "__meta_kubernetes_pod_ip", 219 + ] 220 + targetLabel = "__address__" 221 + }, 222 + { 223 + action = "replace" 224 + regex = "(\\d+);((([0-9]+?)(\\.|$)){4})" 225 + replacement = "$2:$1" 226 + sourceLabels = [ 227 + "__meta_kubernetes_pod_annotation_prometheus_io_port", 228 + "__meta_kubernetes_pod_ip", 229 + ] 230 + targetLabel = "__address__" 231 + }, 232 + { 233 + action = "labeldrop" 234 + regex = "__meta_kubernetes_pod_label_(.+)" 235 + }, 236 + { 237 + action = "replace" 238 + sourceLabels = [ 239 + "__meta_kubernetes_namespace", 240 + ] 241 + targetLabel = "namespace" 242 + }, 243 + { 244 + action = "replace" 245 + sourceLabels = [ 246 + "__meta_kubernetes_pod_name", 247 + ] 248 + targetLabel = "pod" 249 + }, 250 + ] 251 + }, 252 + ] 253 + selector = { 254 + matchExpressions = [ 255 + { 256 + key = "istio-prometheus-ignore" 257 + operator = "DoesNotExist" 258 + }, 259 + ] 260 + } 261 + } 262 + } 263 + } 264 + } 265 + } 266 + } 267 + } 268 + } 269 + }) 270 + }