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

Variable-Substitution for ClusterLabels/Name not working #1644

Closed
1 task done
strowi opened this issue Jul 10, 2023 · 1 comment
Closed
1 task done

Variable-Substitution for ClusterLabels/Name not working #1644

strowi opened this issue Jul 10, 2023 · 1 comment
Labels

Comments

@strowi
Copy link

strowi commented Jul 10, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi,

using the rancher-integrated fleet without the rancher-cluster integration. I deployed a fleet-agent containing labels like "management.cattle.io/cluster-display-name" to replace it with the displayed-name, but it won't show up in the downstream-cluster.

apiServerCA: "" 
apiServerURL: https://xyz
clusterNamespace: fleet-default 
systemRegistrationNamespace: cattle-fleet-clusters-system
token:  xyz
labels: 
  aed.edge: 'true'
  management.cattle.io/cluster-display-name: edge-device-053123

Expected Behavior

Fleet should replace ".ClusterName|.ClusterLabels..." .

Steps To Reproduce

  1. Install Rancher
  2. Create ClusterRegistrationToken
  3. register a cluster helm -n cattle-fleet-system upgrade -i --create-namespace --wait --values values.yaml fleet-agent fleet/fleet-agent
apiServerCA: "" 
apiServerURL: https://xyz
clusterNamespace: fleet-default 
systemRegistrationNamespace: cattle-fleet-clusters-system
token:  xyz
labels: 
  management.cattle.io/cluster-display-name: aedifion-logger-0533
  1. deploy a fleet-bundlie using the above labels e.g. :
defaultNamespace: cattle-monitoring-system

helm:
  chart: ./chart
  releaseName: vm
  maxHistory: 1
  values:
    remoteWriteLabels:
      cluster: global.fleet.clusterLabels.management.cattle.io/cluster-name
      cluster_2: "${ .ClusterName }"

Neither variable will be replaced. I tried multiple different combinations.

kubectl -n cattle-monitoring-system get deploy -o yaml|grep -i -e cluster -e edge
...
          - -remoteWrite.label=cluster=
          - -remoteWrite.label=edge_device=global.fleet.ClusterLabels.management.cattle.io/cluster-name
~>  k logs -f fleet-controller-7bcbb6d755-27qfj
time="2023-07-10T10:01:26Z" level=info msg="Cluster label 'global.fleet.clusterLabels.management.cattle.io/cluster-name' for key 'cluster' is missing from some clusters, setting value to empty string for these clusters."
...

Environment

- Architecture: amd64
- Fleet Version: 0.7.0 (rancher-integrated)
- Cluster:
  - Provider: k3d, k3s
  - Options: 
  - Kubernetes Version: 1.27.3

Logs

No response

Anything else?

No response

@strowi
Copy link
Author

strowi commented Jul 10, 2023

forget it, seems it was another coffee-related error - cluster-name vs cluster-display-name. ;)

@strowi strowi closed this as completed Jul 10, 2023
@zube zube bot removed the [zube]: Done label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant