crossplane-contrib / provider-kubernetes

Crossplane provider to provision and manage Kubernetes objects on (remote) Kubernetes clusters.
Apache License 2.0
140 stars 82 forks source link

feat: add gardener shoot authentication #265

Open Avarei opened 4 months ago

Avarei commented 4 months ago

Description of your changes

Fixes #244

Adds an Authentication Method to Gardener Shoot Clusters using shoot access Implements a custom caching logic to reduce load on Api Server and reuse credentials while they are not expired.

I have:

How has this code been tested

deployed to an environment with gardener running.

created ProviderConfig

apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
  name: kubernetes-provider
spec:
  credentials:
    secretRef:
      key: kubeconfig
      name: gardener-config
      namespace: crossplane-system
    source: Secret
  identity:
    secretRef:
      key: shootRef
      name: exampleshoot
      namespace: crossplane-system
    source: Secret
    type: GardenerShootAdminCredentials
---
apiVersion: v1
kind: Secret
metadata:
  name: exampleshoot
  namespace: crossplane-system
stringData:
  shootRef: shoot-namespace/shoot-name