cisco-open / cluster-registry-controller

An operator that automatically synchronizes Kubernetes resources across multiple clusters
Apache License 2.0
22 stars 8 forks source link

Add provider & distribution info about Rancher k8s cluster #58

Closed Shridhar-2205 closed 1 year ago

Shridhar-2205 commented 1 year ago

Description: Provider & distribution info about Rancher k8s cluster is missing.

k get clusters.clusterregistry.k8s.cisco.com -A -o wide
NAME                            ID                                     STATUS   TYPE    SYNCED   VERSION         PROVIDER   DISTRIBUTION   REGION   STATUS MESSAGE   SYNC MESSAGE
k3sandcalisti-managed-cluster   abcdfgew-123-1234-1234-abdpqra65e7e   Ready    Local            v1.24.14+k3s1                                                                                          

Feature request: Add provider and distribution info for Rancher type cluster.

Feel free to reach out to me for any clarifications.

waynz0r commented 1 year ago

Hi @Shridhar-2205,

what provider and RKE version are you using?

The distribution and provider info are based on node resource info within the cluster, can you please send one of your node resource yaml?

Shridhar-2205 commented 1 year ago
eti-lab> k get nodes -A -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: Node
  metadata:
    annotations:
      flannel.alpha.coreos.com/backend-data: '{"VNI":1,"VtepMAC":""}'
      flannel.alpha.coreos.com/backend-type: vxlan
      flannel.alpha.coreos.com/kube-subnet-manager: "true"
      flannel.alpha.coreos.com/public-ip: 1.1.1.1
      k3s.io/internal-ip: 1.1.1.1
      k3s.io/node-args: '["agent"]'
      k3s.io/node-config-hash: ****
      k3s.io/node-env: '{"K3S_DATA_DIR":"/var/lib/rancher/k3s/data/","K3S_TOKEN":"********","K3S_URL":"https://"}'
      node.alpha.kubernetes.io/ttl: "0"
      volumes.kubernetes.io/controller-managed-attach-detach: "true"
    creationTimestamp: "2023-06-27T17:30:22Z"
    finalizers:
    - wrangler.cattle.io/node
    labels:
      beta.kubernetes.io/arch: amd64
      beta.kubernetes.io/instance-type: k3s
      beta.kubernetes.io/os: linux
      kubernetes.io/arch: amd64
      kubernetes.io/hostname: ip-
      kubernetes.io/os: linux
      node.kubernetes.io/instance-type: k3s
    name: ip-
    resourceVersion: "55091"
    uid: 5b31c507-9363-4124-bf73-c2a771cc7074
  spec:
    podCIDR: 10.42.1.0/24
    podCIDRs:
    - 10.42.1.0/24
    providerID: k3s://ip-
  status:
    addresses:
    - address: 172.31.11.253
      type: InternalIP
    - address: ip-
      type: Hostname
    allocatable:
      cpu: "8"
      ephemeral-storage: "39369928059"
      hugepages-1Gi: "0"
      hugepages-2Mi: "0"
      memory: 15911164Ki
      pods: "110"
    capacity:
      cpu: "8"
      ephemeral-storage: 40470732Ki
      hugepages-1Gi: "0"
      hugepages-2Mi: "0"
      memory: 15911164Ki
      pods: "110"
    conditions:
    - lastHeartbeatTime: "2023-06-27T19:03:36Z"
      lastTransitionTime: "2023-06-27T17:30:22Z"
      message: kubelet has sufficient memory available
      reason: KubeletHasSufficientMemory
      status: "False"
      type: MemoryPressure
    - lastHeartbeatTime: "2023-06-27T19:03:36Z"
      lastTransitionTime: "2023-06-27T17:30:22Z"
      message: kubelet has no disk pressure
      reason: KubeletHasNoDiskPressure
      status: "False"
      type: DiskPressure
    - lastHeartbeatTime: "2023-06-27T19:03:36Z"
      lastTransitionTime: "2023-06-27T17:30:22Z"
      message: kubelet has sufficient PID available
      reason: KubeletHasSufficientPID
      status: "False"
      type: PIDPressure
    - lastHeartbeatTime: "2023-06-27T19:03:36Z"
      lastTransitionTime: "2023-06-27T17:30:32Z"
      message: kubelet is posting ready status. AppArmor enabled
      reason: KubeletReady
      status: "True"
      type: Ready
    daemonEndpoints:
      kubeletEndpoint:
        Port: 10250
    images:
    - names:
      - registry.eticloud.io/smm/smm-vm-integration@sha256:bce078c701d5760c85c09a2b9652ffb5fb836b10861724edb608ebd7977a4e2b
      - registry.eticloud.io/smm/smm-vm-integration:v1.12.0
      sizeBytes: 260938646
    - names:
      - registry.eticloud.io/sdm/istio-pilot@sha256:a8aca428215cf917a2d08007b23e76dff511c211cccfd47f110f8a6bcdcdfa9d
      - registry.eticloud.io/sdm/istio-pilot:v1.15.3-bzc.1
      sizeBytes: 59897387
    - names:
      - registry.eticloud.io/sdm/istio-proxyv2@sha256:e62ded4517447422db73c3b969c4aaa0ff79dfe1fce5de5c02a40d7d3dcc2800
      - registry.eticloud.io/sdm/istio-proxyv2:v1.15.3-bzc-kafka.0
      sizeBytes: 56135325
    - names:
      - registry.eticloud.io/smm/istio-proxyv2@sha256:fb1fbfda425e8ba7d131a76870ce917d56abcae68bfa710f00bd186315c615bd
      - registry.eticloud.io/smm/istio-proxyv2:v1.15.3-bzc.1
      sizeBytes: 56055835
    - names:
      - registry.eticloud.io/smm/smm@sha256:436f96c8a396fcf8ddda8bd44ac214cac9f5cbcf51c187643a628d4a16b5642f
      - registry.eticloud.io/smm/smm:v1.12.0
      sizeBytes: 55866722
    - names:
      - registry.eticloud.io/smm/smm-federation-gateway@sha256:538714024e9d37d0df53983cd621db48492c35ff5fa291747466246b26e90ca0
      - registry.eticloud.io/smm/smm-federation-gateway:v1.12.0
      sizeBytes: 49422371
    - names:
      - registry.eticloud.io/sdm/supertubes-ui@sha256:9e5bcc3bb59d1e7ee4b8bc1bf0f518eccbb0d67daf80c6e92931750910328278
      - registry.eticloud.io/sdm/supertubes-ui:v1.9.0
      sizeBytes: 40390313
    - names:
      - ghcr.io/banzaicloud/imagepullsecrets@sha256:ecfab198d416015962fceefdb26ec26b55e4cc053f2c1032f6e1aa9349214dd2
      - ghcr.io/banzaicloud/imagepullsecrets:v0.3.12
      sizeBytes: 32711464
    - names:
      - registry.eticloud.io/sdm/supertubes@sha256:c4433b30167cd9d51a503cf06e648cd5f9ac83f2fb0f6ae62d0a53353050c313
      - registry.eticloud.io/sdm/supertubes:v1.9.0
      sizeBytes: 28497967
    - names:
      - ghcr.io/banzaicloud/istio-operator@sha256:e0a6cfc731e212ef0ba0366422a468e989e240e653db126bfdc20e7260dedb12
      - ghcr.io/banzaicloud/istio-operator:v2.13.6
      sizeBytes: 28412641
    - names:
      - registry.eticloud.io/smm/smm-sre-api@sha256:135bc684104981bb750e27de3f1b34288241ce1c035c15120fede0e63bca2ed7
      - registry.eticloud.io/smm/smm-sre-api:v1.12.0
      sizeBytes: 26882790
    - names:
      - gcr.io/kubebuilder/kube-rbac-proxy@sha256:d99a8d144816b951a67648c12c0b988936ccd25cf3754f3cd85ab8c01592248f
      - gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
      sizeBytes: 25405613
    - names:
      - registry.eticloud.io/smm/smm-health@sha256:3cc3a78408324f64d189474b7c5067de0c20be91eceeb5e571cbc83fed04425d
      - registry.eticloud.io/smm/smm-health:v1.12.0
      sizeBytes: 23772707
    - names:
      - ghcr.io/cisco-open/cluster-registry-controller@sha256:ca68a2870cd0de83fa442e5b0b6ed53cfa1606796a797e8f228f138de4ed29fd
      - ghcr.io/cisco-open/cluster-registry-controller:v0.2.10
      sizeBytes: 22230750
    - names:
      - quay.io/brancz/kube-rbac-proxy@sha256:b62289c3f3f883ee76dd4e8879042dd19abff743340e451cb59f9654fc472e4f
      - quay.io/brancz/kube-rbac-proxy:v0.11.0
      sizeBytes: 19194873
    - names:
      - quay.io/jetstack/cert-manager-controller@sha256:d429b6d696e0ef47cff1d15241c6ffaac351e38ac22664b82fafa771d615b89a
      - quay.io/jetstack/cert-manager-controller:v1.11.0
      sizeBytes: 18256020
    - names:
      - quay.io/jetstack/cert-manager-webhook@sha256:6730d96fc382a57cde4f7519d2a32b40013e0d3bace2ea0579c7c051fbbd608d
      - quay.io/jetstack/cert-manager-webhook:v1.11.0
      sizeBytes: 14293497
    - names:
      - quay.io/jetstack/cert-manager-cainjector@sha256:5c3eb25b085443b83586a98a1ae07f8364461dfca700e950c30f585efb7474ba
      - quay.io/jetstack/cert-manager-cainjector:v1.11.0
      sizeBytes: 12570894
    - names:
      - k8s.gcr.io/kube-state-metrics/kube-state-metrics@sha256:bdab4e49d71d272cf944c8612dff5ab1250f0fafdae45c22980286ac0c016032
      - registry.k8s.io/kube-state-metrics/kube-state-metrics@sha256:bdab4e49d71d272cf944c8612dff5ab1250f0fafdae45c22980286ac0c016032
      - k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.6.0
      - registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.6.0
      sizeBytes: 11962511
    - names:
      - quay.io/prometheus/node-exporter@sha256:f2269e73124dd0f60a7d19a2ce1264d33d08a985aed0ee6b0b89d0be470592cd
      - quay.io/prometheus/node-exporter:v1.3.1
      sizeBytes: 10347719
    - names:
      - quay.io/prometheus/node-exporter@sha256:a990408ed288669bbad5b5b374fe1584e54825cde4a911c1a3d6301a907a030c
      - quay.io/prometheus/node-exporter:v1.2.2
      sizeBytes: 10199805
    - names:
      - docker.io/rancher/klipper-lb@sha256:2b963c02974155f7e9a51c54b91f09099e48b4550689aadb595e62118e045c10
      - docker.io/rancher/klipper-lb:v0.4.3
      sizeBytes: 4279717
    - names:
      - docker.io/rancher/mirrored-pause@sha256:74c4244427b7312c5b901fe0f67cbc53683d06f4f24c6faee65d4182bf0fa893
      - docker.io/rancher/mirrored-pause:3.6
      sizeBytes: 301463
    nodeInfo:
      architecture: amd64
      bootID: 541ccad7-f0ef-4d0f-a1ec-536b8ebc1735
      containerRuntimeVersion: containerd://1.7.1-k3s1
      kernelVersion: 5.15.0-1011-aws
      kubeProxyVersion: v1.24.14+k3s1
      kubeletVersion: v1.24.14+k3s1
      machineID: ec27585019c42c9186e2b6c677eb01ff
      operatingSystem: linux
      osImage: Ubuntu 22.04 LTS
      systemUUID: ec275850-19c4-2c91-86e2-b6c677eb01ff

It is k3s rancher type cluster

waynz0r commented 1 year ago

Thanks @Shridhar-2205,

I opened a PR with RKE, K3S detection support.