VictoriaMetrics / operator

Kubernetes operator for Victoria Metrics
Apache License 2.0
406 stars 142 forks source link

drop_src_path_prefix_parts in VMAuth.VMAuthSpec.unauthorizedAccessConfig doesn't work #945

Closed dnull88 closed 1 month ago

dnull88 commented 2 months ago

Using last operator version(v0.43.5) with the last version of vmauth (v1.101.0) Option drop_src_path_prefix_parts of object VMAuth.VMAuthSpec.unauthorizedAccessConfig doesnt create config with this option for vmauth:

kind: VMAuth
metadata:
  name: vmcluster
  namespace: vmcluster
  spec:
  unauthorizedAccessConfig:
    - src_paths:
      - "/alertmanager.*"
      url_prefix: ["http://${vmalertmanager_service_name}:9093"]
      drop_src_path_prefix_parts: 1

it creates config like this (without drop_src_path_prefix_parts)

  url_map:
   - url_prefix:
    - http://vmalertmanager-vmcluster:9093
    src_paths:
    - /alertmanager.*
f41gh7 commented 2 months ago

Hello, make sure, that you're using the latest version of CRDs.

By default, helm doesn't update it and manual action required in this case. See upgrade guide for k8s-stack chart https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-k8s-stack#upgrade-guide

copy paste action for CRD update:

kubectl apply -f https://raw.githubusercontent.com/VictoriaMetrics/helm-charts/master/charts/victoria-metrics-k8s-stack/crds/crd.yaml