Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMauth: failed to parse auth config: missing url_prefix or url_map #1169

Open
tropnikovvl opened this issue Nov 25, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@tropnikovvl
Copy link

tropnikovvl commented Nov 25, 2024

Hi, my config looks like this (this is generated by the operator).

users:
- url_prefix:
  - http://vmsingle-vms-victoria-metrics-k8s-stack.vms.svc:8429
  username: user
  password: pass
unauthorized_user:
  url_map:
  - src_paths:
    - /metrics
    url_prefix:
    - http://vmsingle-vms-victoria-metrics-k8s-stack.vms.svc.cluster.local.:8429/
  discover_backend_ips: true

When I remove unauthorized_user map, I get an error
vmauth 2024-11-25T10:11:45.690Z fatal VictoriaMetrics/app/vmauth/auth_config.go:602 cannot load auth config: failed to pars -auth.config="/opt/vmauth/config.yaml": failed to parse auth config: missing "url_prefix" or "url_map"

It seems that the operator does not add the paths from the CR to the configuration or am I doing something wrong?

extraObjects:
- kind: VMUser
  apiVersion: operator.victoriametrics.com/v1beta1
  metadata:
    name: user
    namespace: vms
 # https://docs.victoriametrics.com/operator/api/index.html#vmuserspec
  spec:
    username: user
    password: pass
    targetRefs:
      - crd:
          kind: VMSingle
          name: vms-victoria-metrics-k8s-stack
          namespace: vms
        paths: ["/.*"]

In general, I want to completely remove section unauthorized_user and prohibit unauthorized access to all VM components

@f41gh7
Copy link
Collaborator

f41gh7 commented Nov 25, 2024

Looks like there is a problem with discover_backend_ips: true and any other options defined globally for unauthorizedConfig. It generate incorrect configuration.

Current workaround is to remove discover_backend_ips definition from helm chart spec.

@f41gh7 f41gh7 added the bug Something isn't working label Nov 25, 2024
@f41gh7
Copy link
Collaborator

f41gh7 commented Nov 25, 2024

Related issue #1168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants