brew install kind
brew install helm
curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh
kind create cluster --name crossplane --config kind-cluster.yaml
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update
helm install crossplane --namespace crossplane-system --create-namespace crossplane-stable/crossplane
crossplane xpkg install provider crossplanecontrib/provider-kubernetes:main
kubectl apply -f k8s-provider-config.yaml
SA=$(kubectl -n crossplane-system get sa -o name | grep provider-kubernetes | sed -e 's|serviceaccount\/|crossplane-system:|g')
kubectl create clusterrolebinding provider-kubernetes-admin-binding --clusterrole cluster-admin --serviceaccount="${SA}"
kubectl apply -f k8s-namespace-object.yaml
wget https://github.com/ionos-cloud/crossplane-provider-ionoscloud/archive/main.zip
unzip main.zip && mv crossplane-provider-ionoscloud-master crossplane-provider-ionoscloud && rm main.zip
kubectl apply -f crossplane-provider-ionoscloud/package/crds/ -R
create a file called .ionos_credentials
with the following content:
export IONOS_USERNAME="<your ionos username>"
export IONOS_PASSWORD="<your ionos password>"
export BASE64_PW=$(echo -n "${IONOS_PASSWORD}" | base64)
. ./.ionos_credentials
kubectl create secret generic --namespace crossplane-system ionos-provider-secret --from-literal=credentials="{\"user\":\"${IONOS_USERNAME}\",\"password\":\"${BASE64_PW}\"}"
kubectl apply -f ionos-provider.yaml
kubectl apply -f datacenter.yaml
kubectl apply -f lan.yaml
kubectl apply -f k8s-cluster.yaml
kubectl apply -f lan.yaml