Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 1 | ## See Vector helm documentation to learn more: |
| 2 | ## https://vector.dev/docs/setup/installation/package-managers/helm/ |
| 3 | |
| 4 | # nameOverride -- Override name of app |
| 5 | fullnameOverride: vector |
| 6 | |
| 7 | ## Create a Secret resource for Vector to use |
| 8 | secrets: |
| 9 | # secrets.generic -- Each Key/Value will be added to the Secret's data key, each value should be raw and NOT base64 encoded |
| 10 | ## Any secrets can be provided here, it's commonly used for credentials and other access related values. |
| 11 | ## NOTE: Don't commit unencrypted secrets to git! |
| 12 | generic: |
| 13 | datadog_api_key: "REPLACE_ME" |
| 14 | |
| 15 | ## Configure a HorizontalPodAutoscaler for Vector |
| 16 | autoscaling: |
| 17 | enabled: true |
| 18 | minReplicas: 2 |
| 19 | ## The provided HAProxy config is limited to 10 backends |
| 20 | maxReplicas: 10 |
| 21 | targetCPUUtilizationPercentage: 80 |
| 22 | |
| 23 | podDisruptionBudget: |
| 24 | enabled: true |
| 25 | minAvailable: 1 |
| 26 | |
| 27 | # env -- Set environment variables in Vector containers |
| 28 | ## The examples below leverage examples from secrets.generic and assume no name overrides with a Release name of "vector" |
| 29 | env: |
| 30 | - name: DATADOG_API_KEY |
| 31 | valueFrom: |
| 32 | secretKeyRef: |
| 33 | name: vector |
| 34 | key: datadog_api_key |
| 35 | - name: VECTOR_LOG_FORMAT |
| 36 | value: json |
| 37 | |
| 38 | # envFrom -- Define environment variables from Secrets or ConfigMaps |
| 39 | envFrom: |
| 40 | - secretRef: |
| 41 | name: vector |
| 42 | |
| 43 | # resources -- Set Vector resource requests and limits. |
| 44 | resources: |
| 45 | ## Required for HPA to function |
| 46 | requests: |
| 47 | cpu: 1000m |
| 48 | memory: 512Mi |
| 49 | # limits: |
| 50 | # cpu: 200m |
| 51 | # memory: 256Mi |
| 52 | |
| 53 | # affinity -- Allow Vector to schedule using affinity rules |
| 54 | ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity |
| 55 | affinity: |
| 56 | ## Scale across different AZs by default. |
| 57 | podAntiAffinity: |
| 58 | preferredDuringSchedulingIgnoredDuringExecution: |
| 59 | - weight: 100 |
| 60 | podAffinityTerm: |
| 61 | labelSelector: |
| 62 | matchExpressions: |
| 63 | - key: app.kubernetes.io/name |
| 64 | operator: In |
| 65 | values: |
| 66 | - vector |
| 67 | - key: app.kubernetes.io/component |
| 68 | operator: In |
| 69 | values: |
| 70 | - Aggregator |
| 71 | topologyKey: topology.kubernetes.io/zone |
| 72 | |
| 73 | # customConfig -- Override Vector's default configs, if used **all** options need to be specified |
| 74 | ## This section supports using helm templates to populate dynamic values |
| 75 | ## Ref: https://vector.dev/docs/reference/configuration/ |
| 76 | customConfig: |
| 77 | data_dir: /vector-data-dir |
| 78 | api: |
| 79 | enabled: true |
| 80 | address: 0.0.0.0:8686 |
| 81 | playground: false |
| 82 | sources: |
| 83 | datadog_agent: |
| 84 | address: 0.0.0.0:8282 |
| 85 | type: datadog_agent |
| 86 | multiple_outputs: true |
| 87 | internal_metrics: |
| 88 | type: internal_metrics |
| 89 | transforms: |
| 90 | remap_logs: |
| 91 | type: remap |
| 92 | inputs: |
| 93 | - datadog_agent.logs |
| 94 | source: | |
| 95 | # Parse the received .ddtags field so we can more easily access the contained tags |
| 96 | .ddtags = parse_key_value!(.ddtags, key_value_delimiter: ":", field_delimiter: ",") |
| 97 | .ddtags.sender = "vector" |
| 98 | .ddtags.vector_aggregator = get_hostname!() |
| 99 | # Re-encode Datadog tags as a string for the `datadog_logs` sink |
| 100 | .ddtags = encode_key_value(.ddtags, key_value_delimiter: ":", field_delimiter: ",") |
| 101 | |
| 102 | # Datadog Agents pass a "status" field that is stripped when ingested |
| 103 | del(.status) |
| 104 | sinks: |
| 105 | datadog_logs: |
| 106 | type: datadog_logs |
| 107 | inputs: |
| 108 | - remap_logs |
| 109 | default_api_key: ${DATADOG_API_KEY} |
| 110 | compression: gzip |
| 111 | datadog_metrics: |
| 112 | type: datadog_metrics |
| 113 | inputs: |
| 114 | - datadog_agent.metrics |
| 115 | - internal_metrics |
| 116 | default_api_key: ${DATADOG_API_KEY} |
| 117 | # TODO: soon! |
| 118 | # datadog_traces: |
| 119 | # type: datadog_traces |
| 120 | |
| 121 | # livenessProbe -- Override default liveness probe settings, if customConfig is used requires customConfig.api.enabled true |
| 122 | ## Requires Vector's API to be enabled |
| 123 | livenessProbe: |
| 124 | httpGet: |
| 125 | path: /health |
| 126 | port: api |
| 127 | |
| 128 | # readinessProbe -- Override default readiness probe settings, if customConfig is used requires customConfig.api.enabled true |
| 129 | ## Requires Vector's API to be enabled |
| 130 | readinessProbe: |
| 131 | httpGet: |
| 132 | path: /health |
| 133 | port: api |
| 134 | |
| 135 | ## Optional built-in HAProxy load balancer |
| 136 | haproxy: |
| 137 | # haproxy.enabled -- If true, create a HAProxy load balancer |
| 138 | enabled: true |
| 139 | |
| 140 | # haproxy.customConfig -- Override HAProxy's default configs, if used **all** options need to be specified. |
| 141 | # This parameter supports using Helm templates to insert values dynamically |
| 142 | ## By default this chart will parse Vector's configuration from customConfig to generate HAProxy's config, this generated config |
| 143 | ## can be overwritten with haproxy.customConfig |
| 144 | customConfig: | |
| 145 | global |
| 146 | log stdout format raw local0 |
| 147 | maxconn 4096 |
| 148 | stats socket /tmp/haproxy |
| 149 | hard-stop-after {{ .Values.haproxy.terminationGracePeriodSeconds }}s |
| 150 | |
| 151 | defaults |
| 152 | log global |
| 153 | option dontlognull |
| 154 | retries 3 |
| 155 | option redispatch |
| 156 | option allbackups |
| 157 | timeout client 5s |
| 158 | timeout server 5s |
| 159 | timeout connect 5s |
| 160 | |
| 161 | resolvers coredns |
| 162 | nameserver dns1 kube-dns.kube-system.svc.cluster.local:53 |
| 163 | resolve_retries 3 |
| 164 | timeout resolve 2s |
| 165 | timeout retry 1s |
| 166 | accepted_payload_size 8192 |
| 167 | hold valid 10s |
| 168 | hold obsolete 60s |
| 169 | |
| 170 | frontend stats |
| 171 | mode http |
| 172 | bind :::1024 |
| 173 | option httplog |
| 174 | http-request use-service prometheus-exporter if { path /metrics } |
| 175 | |
| 176 | frontend datadog-agent |
| 177 | mode http |
| 178 | bind :::8282 |
| 179 | option httplog |
| 180 | default_backend datadog-agent |
| 181 | |
| 182 | backend datadog-agent |
| 183 | mode http |
| 184 | balance roundrobin |
| 185 | option tcp-check |
| 186 | server-template srv 10 _datadog-agent._tcp.{{ include "vector.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.cluster.local resolvers coredns check |