kubernetes / autoscaler

Autoscaling components for Kubernetes
Apache License 2.0
7.8k stars 3.87k forks source link

`magnum`: No suitable endpoint could be found in the service catalog. #6987

Open yellowhat opened 2 days ago

yellowhat commented 2 days ago

Which component are you using?: magnum (cluster-autoscaler)

What version of the component are you using?: 1.28.0

Component version:

What k8s version are you using (kubectl version)?:

kubectl version Output
$ kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.2+k3s1

What environment is this in?: ovh (openstack)

What did you expect to happen?:

cluster-autoscaler is able to connect and authenticate to OpenStack (nova)

What happened instead?:

Hi, I am using the following cloud-config file:

[Global]
auth-url=https://auth.cloud.ovh.net/v3/
username=user-xxx
password=yyy
tenant-id=zzz
domain-name=default

the same credentials, options, I use to authenticate via the openstack terraform provider

...
        - name: cluster-autoscaler
          image: docker.io/openstackmagnum/cluster-autoscaler:v1.28.0
          imagePullPolicy: Always
          command:
            - ./cluster-autoscaler
            - --alsologtostderr
            - --cluster-name=cluster.local
            - --cloud-config=/config/cloud-config
            - --cloud-provider=magnum
            - --nodes=1:10:DefaultNodeGroup
            - --v=2
          volumeMounts:
            - name: cloud-config
              mountPath: /config
              readOnly: true
...

but I get the following error on boot:

[leaderelection.go:250] attempting to acquire leader lease kube-system/cluster-autoscaler...
[leaderelection.go:260] successfully acquired lease kube-system/cluster-autoscaler
[request.go:697] Waited for 1.198450606s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/apis/apps/v1/statefulsets?limit=500&resourceVersion=0
[request.go:697] Waited for 2.397401073s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/api/v1/nodes?limit=500&resourceVersion=0
[cloud_provider_builder.go:29] Building magnum cloud provider.
[magnum_cloud_provider.go:341] Failed to create magnum manager: could not create container-infra client: No suitable endpoint could be found in the service catalog.

If I inject OS_* env var:

...
          env:
            - name: OS_AUTH_URL
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: auth-url
            - name: OS_USERNAME
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: username
            - name: OS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: password
            - name: OS_DOMAIN_NAME
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: domain-name
            - name: OS_TENANT_ID
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: tenant-id
            - name: OS_REGION_NAME
              valueFrom:
                secretKeyRef:
                  name: foo
                  key: region
...

I get:

[leaderelection.go:250] attempting to acquire leader lease kube-system/cluster-autoscaler...
[leaderelection.go:260] successfully acquired lease kube-system/cluster-autoscaler
[request.go:697] Waited for 1.198664763s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/api/v1/pods?fieldSelector=status.phase%21%3DFailed%2Cstatus.phase%21%3DSucceeded&limit=500&resourceVersion=0
[request.go:697] Waited for 2.198517653s due to client-side throttling, not priority and fairness, request: GET:https://10.43.0.1:443/apis/apps/v1/daemonsets?limit=500&resourceVersion=0
[cloud_provider_builder.go:29] Building magnum cloud provider.
[magnum_cloud_provider.go:341] Failed to create magnum manager: could not create provider client: could not authenticate client: You must provide a password to authenticate

Any suggestions?

Thanks