Skip to content

Commit

Permalink
move kubeadm specific config into default
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 committed Feb 26, 2024
1 parent f42c538 commit 37dd717
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 24 deletions.
7 changes: 3 additions & 4 deletions templates/flavors/base/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
cni: cilium
ccm: linode
crs: ${CLUSTER_NAME}-crs
cluster: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.128.0/17
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
kind: REPLACEME
name: ${CLUSTER_NAME}-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
Expand Down
3 changes: 2 additions & 1 deletion templates/flavors/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster.yaml
- kubeadm-control-plane.yaml
- linode-cluster.yaml
- linode-machine-template.yaml
- machine-deployment.yaml
18 changes: 16 additions & 2 deletions templates/flavors/base/linode-machine-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,19 @@ spec:
type: ${LINODE_CONTROL_PLANE_MACHINE_TYPE}
region: ${LINODE_REGION}
authorizedKeys:
# uncomment to include your ssh key in linode provisioning
# - ${LINODE_SSH_PUBKEY:=""}
# uncomment to include your ssh key in linode provisioning
# - ${LINODE_SSH_PUBKEY:=""}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: LinodeMachineTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
spec:
template:
spec:
image: ${LINODE_OS:="linode/ubuntu22.04"}
type: ${LINODE_MACHINE_TYPE}
region: ${LINODE_REGION}
authorizedKeys:
# uncomment to include your ssh key in linode provisioning
# - ${LINODE_SSH_PUBKEY:=""}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
Expand All @@ -15,7 +16,7 @@ spec:
configRef:
name: ${CLUSTER_NAME}-md-0
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
kind: REPLACEME
infrastructureRef:
name: ${CLUSTER_NAME}-md-0
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
Expand Down
34 changes: 32 additions & 2 deletions templates/flavors/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
resources:
- ../base
- kubeadm-config-template.yaml
- linode-machine-template.yaml
- machine-deployment.yaml
- kubeadm-control-plane.yaml
- ../../common-init-files
- ../../addons/cilium
- ../../addons/provider-linode
- ../../addons/cluster-resource-set
patches:
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
patch: |-
- op: replace
path: /spec/controlPlaneRef/kind
value: KubeadmControlPlane
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
patch: |-
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
cni: cilium
ccm: linode
crs: ${CLUSTER_NAME}-crs
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
patch: |-
- op: replace
path: /spec/template/spec/bootstrap/configRef/kind
value: KubeadmConfigTemplate
14 changes: 0 additions & 14 deletions templates/flavors/default/linode-machine-template.yaml

This file was deleted.

0 comments on commit 37dd717

Please sign in to comment.