Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add preparation of clusterclass #141

Merged
Merged
31 changes: 22 additions & 9 deletions hack/test-cluster-class.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@ if [[ ! -f "./.envfile" ]]; then
fi
source ./.envfile
lubedacht marked this conversation as resolved.
Show resolved Hide resolved

clusterctl generate yaml --from templates/clusterclass-template.yaml > ./output/generated-clusterclass-template-replaced.yaml
clusterctl generate cluster $CLUSTER_NAME --from templates/cluster-template-topology.yaml > ./output/generated-cluster-template-topology.yaml
#
#echo "validate"
echo "Setup Cluster API with ClusterResourceSet and ClusterTopology"
echo "export EXP_CLUSTER_RESOURCE_SET=\"true\""
echo "export CLUSTER_TOPOLOGY=\"true\""
echo "clusterclt init --infrastructure=ionos-cloud"
jriedel-ionos marked this conversation as resolved.
Show resolved Hide resolved

echo "done"
#clusterctl alpha topology plan -f ./templates/clusterclass-template-replaced.yaml -f ./templates/cluster-template-topology-replaced.yaml -o output/
GENERATED_CLUSTER_CLASS_FILE="./output/generated-clusterclass-template.yaml"
GENERATED_CLUSTER_FILE="./output/generated-cluster-template-topology-calico.yaml"

# echo "apply"
#kubectl apply -f ./templates/clusterclass-template-replaced.yaml
#kubectl apply -f ./templates/cluster-template-topology-replaced.yaml
clusterctl generate yaml --from ./templates/clusterclass-template.yaml > $GENERATED_CLUSTER_CLASS_FILE
clusterctl generate cluster $CLUSTER_NAME -n $NAMESPACE --from ./templates/cluster-template-topology-calico.yaml > $GENERATED_CLUSTER_FILE

echo "Validate generated resources"
clusterctl alpha topology plan -f $GENERATED_CLUSTER_CLASS_FILE -f $GENERATED_CLUSTER_FILE -o output/
lubedacht marked this conversation as resolved.
Show resolved Hide resolved

echo "Apply cluster class resources"
echo "kubectl apply -f $GENERATED_CLUSTER_CLASS_FILE"
echo "Apply cluster which uses the cluster class resources"
echo "kubectl apply -f $GENERATED_CLUSTER_FILE"

echo "Installing calico cni"
echo "make crs-calico"
echo "kubectl apply -f ./templates/crs/cni/calico.yaml"
lubedacht marked this conversation as resolved.
Show resolved Hide resolved

echo "Done"
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ type: Opaque
stringData:
token: "${IONOS_TOKEN}"
apiURL: "${IONOS_API_URL:-https://api.ionos.com/cloudapi/v6}"
---
apiVersion: addons.cluster.x-k8s.io/v1beta1
kind: ClusterResourceSet
metadata:
labels:
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
name: ${CLUSTER_NAME}-crs-0
namespace: '${NAMESPACE}'
spec:
clusterSelector:
matchLabels:
cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}'
resources:
- kind: ConfigMap
name: calico
Loading