From 1c086e8ea30c81176fa4cc96c16049d0448c617f Mon Sep 17 00:00:00 2001 From: Ela AWS <51791117+elamaran11@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:47:00 -0500 Subject: [PATCH] EKS ClusterAuth Samples to Managed Resources. (#170) * Adding EKS Cluster Auth Example --- examples/aws-provider/README.md | 31 +++++++++++++++++++ .../managed-resources/eks-clusterauth.yaml | 13 ++++++++ 2 files changed, 44 insertions(+) create mode 100644 examples/aws-provider/managed-resources/eks-clusterauth.yaml diff --git a/examples/aws-provider/README.md b/examples/aws-provider/README.md index a5dcf9d8..945402a6 100644 --- a/examples/aws-provider/README.md +++ b/examples/aws-provider/README.md @@ -41,6 +41,37 @@ kubectl apply -f managed-resources/vpc.yaml kubectl get VPC aws-provider-vpc ``` +## Authenticate with an existing EKS Cluster using AWS Provider + +The following shows an example of how to authenticate and retrieve `kubeconfig` from an existing remote EKS Cluster using AWS Provider + +```shell +# Please make sure to replace `` with your EKS cluster name in the below file before applying. +kubectl apply -f managed-resources/eks-clusterauth.yaml + +# Verify the resource. When authentication is complete, you should see READY: True in the output. +kubectl get clusterauths.eks.aws.upbound.io + +NAME READY SYNCED EXTERNAL-NAME AGE +eks-x86-us-east-2-1-28-blueprint True True eks-x86-us-east-2-1-28-blueprint 11d + +# Verify if the secret has pulled the `kubeconfig` of a remote cluster to management cluster. +kubectl describe secret eks-x86-us-east-2-1-28-eks-connection -n upbound-system + +Name: eks-x86-us-east-2-1-28-eks-connection +Namespace: upbound-system +Labels: +Annotations: + +Type: connection.crossplane.io/v1alpha1 + +Data +==== +clusterCA: 1107 bytes +endpoint: 72 bytes +kubeconfig: 4314 bytes +``` + ## Crossplane Kubernetes Provider The following example shows the creation of Namespace with Crossplane Kuberentes provider diff --git a/examples/aws-provider/managed-resources/eks-clusterauth.yaml b/examples/aws-provider/managed-resources/eks-clusterauth.yaml new file mode 100644 index 00000000..a10c0028 --- /dev/null +++ b/examples/aws-provider/managed-resources/eks-clusterauth.yaml @@ -0,0 +1,13 @@ +apiVersion: eks.aws.upbound.io/v1beta1 +kind: ClusterAuth +metadata: + name: +spec: + forProvider: + region: eu-west-1 + clusterName: + providerConfigRef: + name: default + writeConnectionSecretToRef: + namespace: upbound-system + name: -connection \ No newline at end of file