crossplane-contrib / provider-jet-azure

Apache License 2.0
17 stars 20 forks source link

AKS cluster secret missing kubeconfig #112

Closed vfarcic closed 2 years ago

vfarcic commented 2 years ago

What happened?

Providers like Kubernetes and Helm expect a secret with kubeconfig value. Such secrets are created when using AWS, Azure, or GCP providers. However, Terrajet Azure is not adding kubeconfig entry into the secret, thus preventing us to combine it with other providers.

Here's the output of the secret created by the KubernetesCluster resource:

apiVersion: v1
data:
  attribute.kube_admin_config_raw: ""
  attribute.kube_config.0.client_certificate: ...
  attribute.kube_config.0.client_key: ...
  attribute.kube_config.0.cluster_ca_certificate: ...
  attribute.kube_config.0.password: ...
  attribute.kube_config_raw: ...
kind: Secret
metadata:
  creationTimestamp: "2021-12-10T23:18:51Z"
  name: ateamaks-akscluster
  namespace: crossplane-system
  ownerReferences:
  - apiVersion: containerservice.azure.jet.crossplane.io/v1alpha1
    controller: true
    kind: KubernetesCluster
    name: ateamaks
    uid: 96dcbc34-1b4d-4d64-ad9d-3168209d47a3
  resourceVersion: "13565"
  uid: 6b1a8c0f-bbc5-4319-9308-fa72423cb0a4
type: connection.crossplane.io/v1alpha1

How can we reproduce it?

Create an EKS cluster through KubernetesCluster.

kubectl -n crossplane-system get secret THE_NAME_OF_THE_SECRET -o yaml

Config that data entry kubeconfig does not exist.

turkenh commented 2 years ago

@vfarcic attribute.kube_config_raw key already contains the kubeconfig for the cluster and you should be able to pass this as a key to provider helm/kubernetes providerconfig.

Still, it makes sense to add a kubeconfig to be consistent with others, opened #113