adamant-kite-43734
01/08/2025, 7:29 PMcreamy-pencil-82913
01/08/2025, 7:33 PMproviderID <rke2://testjs2-worker-8bkz5-2dwvt> is invalid for EC2 instances
You need to deploy your cluster with the AWS cloud provider if you want to use the AWS LB controller. Either that or manually set the provider ID on your nodes via the kubelet arg. By default the RKE2 stub cloud provider will set the providerID to <rke2://NODENAME>
which does not match the format that the AWS LB controller needs to look up the instance.dazzling-bird-17431
01/08/2025, 7:53 PMcreamy-pencil-82913
01/08/2025, 7:59 PM--provider-id
string. You’d need to determine what format AWS wants, and how to set it correctly on a per-node basis.
It would probably be easier to build a new cluster with the correct cloud provider deployed, since the providerID cannot be changed on existing nodes, so you’ll have to rebuild anyway.dazzling-bird-17431
01/08/2025, 8:00 PMdazzling-bird-17431
01/08/2025, 8:28 PMcreamy-pencil-82913
01/08/2025, 8:31 PMdazzling-bird-17431
01/08/2025, 8:31 PMpurple-match-66532
02/06/2025, 5:14 PMpurple-match-66532
02/06/2025, 5:14 PMpurple-match-66532
02/06/2025, 5:15 PMdazzling-bird-17431
02/06/2025, 6:02 PMresource "rancher2_cluster_v2" "rke2_cluster" {
rke_config {
...
additional_manifest = <<EOF
---
apiVersion: <http://helm.cattle.io/v1|helm.cattle.io/v1>
kind: HelmChart
metadata:
name: aws-cloud-controller-manager
namespace: kube-system
spec:
chart: aws-cloud-controller-manager
repo: <https://kubernetes.github.io/cloud-provider-aws>
targetNamespace: kube-system
bootstrap: true
valuesContent: |-
hostNetworking: true
nodeSelector:
<http://node-role.kubernetes.io/control-plane|node-role.kubernetes.io/control-plane>: "true"
args:
- --configure-cloud-routes=false
- --v=5
- --cloud-provider=aws
EOF
machine_global_config = <<EOF
cloud-provider-name: aws
EOF
machine_selector_config {
config = <<EOF
disable-cloud-controller: true
kube-apiserver-arg:
- cloud-provider=external
kube-controller-manager-arg:
- cloud-provider=external
kubelet-arg:
- cloud-provider=external
EOF
machine_label_selector {
match_expressions {
key = "<http://rke.cattle.io/control-plane-role|rke.cattle.io/control-plane-role>"
operator = "In"
values = ["true"]
}
}
}
machine_selector_config {
config = <<EOF
kubelet-arg:
- cloud-provider=external
EOF
machine_label_selector {
match_expressions {
key = "<http://rke.cattle.io/worker-role|rke.cattle.io/worker-role>"
operator = "In"
values = ["true"]
}
}
}
Hope this helps
Also, i'm using rke2 v1.31.3+rke2r1 I also had issues with older versions.creamy-pencil-82913
02/06/2025, 6:05 PMpurple-match-66532
02/06/2025, 6:08 PMpurple-match-66532
02/06/2025, 6:22 PMdazzling-bird-17431
02/06/2025, 6:23 PMpurple-match-66532
02/06/2025, 6:33 PMpurple-match-66532
02/06/2025, 6:42 PMcreamy-pencil-82913
02/06/2025, 6:56 PMpurple-match-66532
02/06/2025, 6:57 PMpurple-match-66532
02/06/2025, 6:57 PMcreamy-pencil-82913
02/06/2025, 6:58 PMdazzling-bird-17431
02/06/2025, 6:58 PMpurple-match-66532
02/06/2025, 6:58 PMsudo docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
purple-match-66532
02/06/2025, 7:08 PMcreamy-pencil-82913
02/06/2025, 7:23 PMpurple-match-66532
02/06/2025, 7:34 PM- config
entries under rkeConfig -> machineSelectorConfig
)? Sorry if that is a really dumb questionpurple-match-66532
02/06/2025, 7:35 PMpurple-match-66532
02/06/2025, 8:44 PMcreamy-pencil-82913
02/06/2025, 9:15 PMpurple-match-66532
02/06/2025, 10:06 PMcreamy-pencil-82913
02/06/2025, 10:07 PMcreamy-pencil-82913
02/06/2025, 10:07 PMkubectl get node -o wide
and see what it says.purple-match-66532
02/06/2025, 10:10 PMpurple-match-66532
02/06/2025, 10:13 PMcreamy-pencil-82913
02/06/2025, 10:45 PMpurple-match-66532
02/06/2025, 10:59 PMAmazon
if relying on the above mechanism to set the provider ID. Otherwise, select External (out-of-tree) cloud provider, which sets --cloud-provider=external
for Kubernetes components.
And the message at the top:
In Kubernetes 1.27 and later, you must use an out-of-tree AWS cloud provider. In-tree cloud providers have been deprecated.purple-match-66532
02/07/2025, 1:49 AM# Kubernetes version to use for Rancher server cluster
rancher_kubernetes_version = "v1.31.3+k3s1"
# Rancher server version (format: v0.0.0)
rancher_version = "2.10.1"
# Kubernetes version to use for managed workload cluster
workload_kubernetes_version = "v1.31.4+rke2r1"
Now I'm seeing:
1. Failures to pull from ECR - seemingly because its not using the instance profile for some reason and doesn't have credentials.
2. Failures from the AWS Cloud Controller Daemonset:
Invalidating discovery information
k8s.io/client-go@v0.27.0/tools/cache/reflector.go:231: forcing resync
successfully renewed lease kube-system/cloud-controller-manager
lock is held by pool-2-****** and has not yet expired
failed to acquire lease kube-system/cloud-controller-manager
lock is held by pool-2-****** and has not yet expired
failed to acquire lease kube-system/cloud-controller-manager
successfully renewed lease kube-system/cloud-controller-manager
successfully renewed lease kube-system/cloud-controller-manager
lock is held by pool-2-****** and has not yet expired
failed to acquire lease kube-system/cloud-controller-manager