-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c36f6f
commit 7d684df
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Kubernetes cluster configuration | ||
export KUBERNETES_VERSION=1.27.0 | ||
export CONTROL_PLANE_MACHINE_COUNT=1 | ||
export WORKER_MACHINE_COUNT=1 | ||
|
||
# MaaS domain to use | ||
export MAAS_DNS_DOMAIN="maas" | ||
|
||
# Control plane machine configuration | ||
export CONTROL_PLANE_MACHINE_MINCPU="1" | ||
export CONTROL_PLANE_MACHINE_MINMEMORY="2" | ||
export CONTROL_PLANE_MACHINE_IMAGE="ubuntu" | ||
|
||
# Worker machine configuration | ||
export WORKER_MACHINE_MINCPU="1" | ||
export WORKER_MACHINE_MINMEMORY="2" | ||
export WORKER_MACHINE_IMAGE="ubuntu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Based on https://github.com/spectrocloud/cluster-api-provider-maas/blob/v4.0.2-spectro/templates/cluster-template.yaml | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
spec: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasCluster | ||
name: ${CLUSTER_NAME} | ||
controlPlaneRef: | ||
kind: MicroK8sControlPlane | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
name: ${CLUSTER_NAME}-control-plane | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasCluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
spec: | ||
dnsDomain: ${MAAS_DNS_DOMAIN} | ||
--- | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: MicroK8sControlPlane | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
spec: | ||
controlPlaneConfig: | ||
initConfiguration: | ||
joinTokenTTLInSecs: 9000 | ||
IPinIP: true | ||
addons: | ||
- dns | ||
- ingress | ||
clusterConfiguration: | ||
portCompatibilityRemap: true | ||
machineTemplate: | ||
infrastructureTemplate: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasMachineTemplate | ||
name: "${CLUSTER_NAME}-control-plane" | ||
replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1} | ||
version: "v${KUBERNETES_VERSION}" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasMachineTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-control-plane" | ||
spec: | ||
template: | ||
spec: | ||
minCPU: ${CONTROL_PLANE_MACHINE_MINCPU} | ||
minMemory: ${CONTROL_PLANE_MACHINE_MINMEMORY} | ||
image: ${CONTROL_PLANE_MACHINE_IMAGE} | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
replicas: ${WORKER_MACHINE_COUNT:=1} | ||
selector: | ||
matchLabels: | ||
template: | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
version: "${KUBERNETES_VERSION}" | ||
bootstrap: | ||
configRef: | ||
name: "${CLUSTER_NAME}-md-0" | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: MicroK8sConfigTemplate | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasMachineTemplate | ||
name: "${CLUSTER_NAME}-md-0" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: MaasMachineTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
template: | ||
spec: | ||
minCPU: ${WORKER_MACHINE_MINCPU} | ||
minMemory: ${WORKER_MACHINE_MINMEMORY} | ||
image: ${WORKER_MACHINE_IMAGE} | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: MicroK8sConfigTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-0" | ||
spec: | ||
template: | ||
spec: {} |