- Create file with the AWS creds called aws-creds.conf
aws_access_key_id = <AWS_ACCESS_KEY_I>
aws_secret_access_key = <AWS_SECRET_ACCESS_KE>
Create the secret:
kubectl -n crossplane-system \
create secret generic aws-creds \
--from-file creds=./aws-creds.conf- Add cross plane helm repo
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update- Install crossplane
kubectl create namespace crossplane-system
helm upgrade --install \
crossplane crossplane-stable/crossplane \
--namespace crossplane-system \
--create-namespace \
--waitand the cli
curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh- Create provider-aws.yaml with
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: crossplane-provider-aws
spec:
package: crossplane/provider-aws:v0.22.0- Apply the provider
kubectl apply -f provider-aws.yaml- Create provider-config-aws.yaml with:
apiVersion: aws.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: aws-creds
key: creds- Apply the provider config
kubectl apply -f provider-aws.yaml- Create provider-helm.yaml:
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: crossplane-provider-helm
spec:
package: crossplane/provider-helm:v0.9.0- Apply the provider config
kubectl apply -f provider-helm.yaml- Create provider-k8s.yaml:
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: crossplane-provider-kubernetes
spec:
package: crossplane/provider-kubernetes:main- Apply provider:
kubectl apply -f provider-k8s.yaml- APply XRD, composiste etc from OCI registry. Create config-k8s.yaml:
Based on this repo: https://github.com/cem-altuner/crossplane-prod-ready-eks/tree/master/packages/k8s
apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
name: crossplane-k8s
spec:
package: cemaltuner/crossplane-k8s:v0.2.14- Apply the config:
kubectl apply -f config.k8s.yaml- Check the status of the providers:
kubectl get pkgrev- Create namespace for a team:
kubectl create namespace team-a- Create a ClusterClaim for team-a to create an EKS cluster. Create aws-eks.yaml:
apiVersion: prodready.cluster/v1alpha1
kind: ClusterClaim
metadata:
name: team-a-eks
labels:
cluster-owner: cem
spec:
id: team-a-eks
compositionSelector:
matchLabels:
provider: aws
cluster: eks
parameters:
nodeSize: small
minNodeCount: 1
version: "1.25"- Apply cluster definitions:
kubectl -n team-a apply -f aws-eks.yaml- Wait for the
ClusterClaimto be Ready