Skip to content

Commit

Permalink
tweak variables so --list-variables shows accurate output
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine committed Feb 20, 2024
1 parent 2bdbe1f commit 0a11aa1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
16 changes: 2 additions & 14 deletions docs/book/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,13 @@ Here is a list of required configuration parameters:
```bash
# Cluster settings
export CLUSTER_NAME=capl-cluster
export KUBERNETES_VERSION=1.29.1
export LINODE_REGION=us-ord
export KUBERNETES_VERSION=v1.29.1

# Linode settings
export LINODE_REGION=us-ord
export LINODE_TOKEN=<your linode PAT>

# Machine settings
export LINODE_OS=linode/ubuntu22.04
export LINODE_CONTROL_PLANE_MACHINE_TYPE=g6-standard-2
export LINODE_MACHINE_TYPE=g6-standard-2
export CONTROL_PLANE_MACHINE_COUNT=3
export WORKER_MACHINE_COUNT=3

# Generate SSH key.
# If you want to provide your own key, skip this step and set LINODE_SSH_KEY to your existing public key.
SSH_KEY_FILE=.linodeSSHkey
rm -f "${SSH_KEY_FILE}"
ssh-keygen -t rsa -b 4096 -f "${SSH_KEY_FILE}" -N '' 1>/dev/null
export LINODE_SSH_KEY="$(cat "${SSH_KEY_FILE}.pub)"
```

~~~admonish tip
Expand Down
19 changes: 11 additions & 8 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
key: kubeadm-pre-init.sh
permissions: "0500"
preKubeadmCommands:
- /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION#[vV]}
- /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION}
clusterConfiguration:
apiServer:
extraArgs:
Expand Down Expand Up @@ -91,11 +91,12 @@ metadata:
spec:
template:
spec:
image: ${LINODE_OS:=""}
image: ${LINODE_OS:="linode/ubuntu22.04"}
type: ${LINODE_CONTROL_PLANE_MACHINE_TYPE}
region: ${LINODE_REGION}
authorizedKeys:
- ${LINODE_SSH_KEY:=""}
# uncomment to include your ssh key in linode provisioning
# - ${LINODE_SSH_PUBKEY:=""}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
Expand Down Expand Up @@ -127,11 +128,12 @@ metadata:
spec:
template:
spec:
image: ${LINODE_OS:=""}
image: ${LINODE_OS:="linode/ubuntu22.04"}
type: ${LINODE_MACHINE_TYPE}
region: ${LINODE_REGION}
authorizedKeys:
- ${LINODE_SSH_KEY:=""}
# uncomment to include your ssh key in linode provisioning
# - ${LINODE_SSH_PUBKEY:=""}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
Expand Down Expand Up @@ -163,7 +165,7 @@ spec:
key: kubeadm-pre-init.sh
permissions: "0500"
preKubeadmCommands:
- /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION#[vV]}
- /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION}
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand Down Expand Up @@ -199,11 +201,12 @@ stringData:
export DEBIAN_FRONTEND=noninteractive
hostnamectl set-hostname "$1" && hostname -F /etc/hostname
mkdir -p -m 755 /etc/apt/keyrings
VERSION=$${2%.*}
PATCH_VERSION=$${2#[v]}
VERSION=$${PATCH_VERSION%.*}
curl -fsSL "https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/Release.key" | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt-get update -y
apt-get install -y kubelet=$2* kubeadm=$2* kubectl=$2* containerd
apt-get install -y kubelet=$PATCH_VERSION* kubeadm=$PATCH_VERSION* kubectl=$PATCH_VERSION* containerd
apt-mark hold kubelet kubeadm kubectl containerd
modprobe overlay
modprobe br_netfilter
Expand Down

0 comments on commit 0a11aa1

Please sign in to comment.