# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:552185537300:cluster/centralized-storage-dev-global -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:552185537300:cluster/centralized-storage-dev-regional-us-west-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:552185537300:cluster/o11y-staging-global-us-west-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:552185537300:cluster/o11y-staging-regional-us-west-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector

# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:557537366020:cluster/o11y-prod-global-us-west-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-west-2:557537366020:cluster/o11y-prod-regional-us-west-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:us-east-1:557537366020:cluster/o11y-prod-regional-us-east-1 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:ap-southeast-1:557537366020:cluster/o11y-prod-regional-ap-southeast-1 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:ap-northeast-1:557537366020:cluster/o11y-prod-regional-ap-northeast-1 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:ap-northeast-2:557537366020:cluster/o11y-prod-regional-ap-northeast-2 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:ap-south-1:557537366020:cluster/o11y-prod-regional-ap-south-1 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector
# helm upgrade --kubeconfig ~/.kube/o11y-eks --kube-context arn:aws:eks:eu-central-1:557537366020:cluster/o11y-prod-regional-eu-central-1 -n self-monitoring -i -f vector.yaml self-vector ../../../charts/vector

customConfig:
  data_dir: /vector-data-dir
  api:
    enabled: true
    address: 0.0.0.0:8686
    playground: false

  sources:
    all_logs:
      type: kubernetes_logs
      fingerprint_lines: 2
    journald:
      type: journald
    self_metrics:
      type: internal_metrics
    self_logs:
      type: internal_logs
  sinks:
    loki:
      type: loki
      inputs:
        - all_logs
      # host network should be disabled
      endpoint: http://loki-ha-write.observability.svc.cluster.local:3100
      labels:
        namespace: |-
          {{ `{{ kubernetes.pod_namespace }}` }}
        container: |-
          {{ `{{ kubernetes.container_name }}` }}
        node: |-
          {{ `{{ kubernetes.pod_node_name }}` }}
        app: |-
          {{ `{{ kubernetes.pod_name }}` }}
        stream: |-
          {{ `{{ stream  }}` }}
        cluster: "o11y-control-plane"
      compression: "gzip"
      out_of_order_action: "accept"
      encoding:
        codec: text
    self_metrics_sink:
      type: prometheus_exporter
      inputs:
        - self_metrics
      address: "0.0.0.0:9598"
    self_logs_sink:
      type: loki
      inputs:
        - self_logs
      labels:
        node: |-
          {{ `{{ host }}` }}
        app: "vector_log_agent"
        cluster: "o11y-control-plane"
      endpoint: http://loki-ha-write.observability.svc.cluster.local:3100
      compression: "gzip"
      out_of_order_action: "accept"
      encoding:
        codec: text
    loki_sys_logs:
      type: loki
      inputs:
        - journald
      labels:
        node: |-
          {{ `{{ host }}` }}
        syslog: |-
          {{ "{{ SYSLOG_IDENTIFIER }}" }}
        cluster: "o11y-control-plane"
      endpoint: http://loki-ha-write.observability.svc.cluster.local:3100
      compression: "gzip"
      out_of_order_action: "accept"
      encoding:
        codec: text

# resources -- Set Vector resource requests and limits.
resources:
  requests:
    cpu: "10m"
    memory: "100Mi"
  limits:
    cpu: "500m"
    memory: "1000Mi"

role: "Agent"

## Configuration for Vector's data persistence
## Persistence always used for Agent role
persistence:
  hostPath:
    # persistence.hostPath.path -- Override path used for hostPath persistence
    ## Valid for Agent role
    path: "/var/lib/vector/01"

# Mount machine id to fix journalctl. Refer to https://github.com/vectordotdev/vector/issues/5225
# extraVolumes -- Additional Volumes to use with Vector Pods
extraVolumes:
  - name: machine-id
    hostPath:
      path: /etc/machine-id
      type: File

# extraVolumeMounts -- Additional Volume to mount into Vector Containers
extraVolumeMounts:
  - name: machine-id
    mountPath: /etc/machine-id
    readOnly: true

# rollWorkload -- Add a checksum of the generated ConfigMap to workload annotations
rollWorkload: true

## Define the Vector image to use
image:
  # image.repository -- Override default registry + name for Vector
  repository: gcr.io/pingcap-public/dbaas/vector
  # image.pullPolicy -- Vector image pullPolicy
  pullPolicy: IfNotPresent
  tag: 0.37.1-76b50d-debian

## Configure a HorizontalPodAutoscaler for Vector
## Valid for Aggregator and Stateless-Aggregator roles
autoscaling:
  # autoscaling.enabled -- Enabled autoscaling for the Aggregator and Stateless-Aggregator
  enabled: false
  # autoscaling.minReplicas -- Minimum replicas for Vector's HPA

podDisruptionBudget:
  # podDisruptionBudget.enabled -- Enable a PodDisruptionBudget for Vector
  enabled: false

rbac:
  # rbac.create -- If true, create and use RBAC resources. Only valid for the Agent role
  create: true

psp:
  # psp.create -- If true, create a PodSecurityPolicy resource. PodSecurityPolicy is deprecated as of Kubernetes v1.21, and will be removed in v1.25
  ## Intended for use with the Agent role
  create: false

serviceAccount:
  # serviceAccount.create -- If true, create ServiceAccount
  create: true
  # serviceAccount.automountToken -- Automount API credentials for the Vector ServiceAccount
  automountToken: true

# tolerations -- Allow Vector to schedule on tainted nodes
tolerations:
  - operator: Exists

## Configuration for Vector's Service
service:
  # service.enabled -- If true, create and use a Service resource
  enabled: false

## Configuration for Vector's Ingress
ingress:
  # ingress.enabled -- If true, create and use an Ingress resource
  enabled: false

# livenessProbe -- Override default liveness probe settings, if customConfig is used requires customConfig.api.enabled true
## Requires Vector's API to be enabled
livenessProbe:
  httpGet:
    path: /health
    port: api

# readinessProbe -- Override default readiness probe settings, if customConfig is used requires customConfig.api.enabled true
## Requires Vector's API to be enabled
readinessProbe:
  httpGet:
    path: /health
    port: api

## Configure a PodMonitor for Vector
## Requires the PodMonitor CRD to be installed
podMonitor:
  # podMonitor.enabled -- If true, create a PodMonitor for Vector
  enabled: false

## Optional built-in HAProxy load balancer
haproxy:
  # haproxy.enabled -- If true, create a HAProxy load balancer
  enabled: false
