mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Add basic structure and files
Add basic directory structure and files for scenario on using kustomize with Cluster API Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
This commit is contained in:
parent
478d182106
commit
fa6604ab07
8 changed files with 145 additions and 0 deletions
3
kubernetes/capi-kustomize/README.md
Normal file
3
kubernetes/capi-kustomize/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Using Kustomize with Cluster API
|
||||
|
||||
These files were created as examples to accompany [this blog post](https://blog.scottlowe.org/2019/11/04/using-kustomize-with-cluster-api-manifests/) on using `kustomize` with Cluster API (CAPI) manifests.
|
||||
21
kubernetes/capi-kustomize/base/cluster.yaml
Normal file
21
kubernetes/capi-kustomize/base/cluster.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
apiVersion: cluster.x-k8s.io/v1alpha2
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: capi-quickstart
|
||||
spec:
|
||||
clusterNetwork:
|
||||
pods:
|
||||
cidrBlocks: ["192.168.0.0/16"]
|
||||
infrastructureRef:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSCluster
|
||||
name: capi-quickstart
|
||||
---
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSCluster
|
||||
metadata:
|
||||
name: capi-quickstart
|
||||
spec:
|
||||
region: us-east-1
|
||||
sshKeyName: default
|
||||
46
kubernetes/capi-kustomize/base/controlplane.yaml
Normal file
46
kubernetes/capi-kustomize/base/controlplane.yaml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
apiVersion: cluster.x-k8s.io/v1alpha2
|
||||
kind: Machine
|
||||
metadata:
|
||||
name: capi-quickstart-controlplane-0
|
||||
labels:
|
||||
cluster.x-k8s.io/control-plane: "true"
|
||||
cluster.x-k8s.io/cluster-name: "capi-quickstart"
|
||||
spec:
|
||||
version: v1.15.3
|
||||
bootstrap:
|
||||
configRef:
|
||||
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
|
||||
kind: KubeadmConfig
|
||||
name: capi-quickstart-controlplane-0
|
||||
infrastructureRef:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSMachine
|
||||
name: capi-quickstart-controlplane-0
|
||||
---
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSMachine
|
||||
metadata:
|
||||
name: capi-quickstart-controlplane-0
|
||||
spec:
|
||||
instanceType: t3.large
|
||||
iamInstanceProfile: "controllers.cluster-api-provider-aws.sigs.k8s.io"
|
||||
sshKeyName: default
|
||||
---
|
||||
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
|
||||
kind: KubeadmConfig
|
||||
metadata:
|
||||
name: capi-quickstart-controlplane-0
|
||||
spec:
|
||||
initConfiguration:
|
||||
nodeRegistration:
|
||||
name: '{{ ds.meta_data.hostname }}'
|
||||
kubeletExtraArgs:
|
||||
cloud-provider: aws
|
||||
clusterConfiguration:
|
||||
apiServer:
|
||||
extraArgs:
|
||||
cloud-provider: aws
|
||||
controllerManager:
|
||||
extraArgs:
|
||||
cloud-provider: aws
|
||||
7
kubernetes/capi-kustomize/base/kustomization.yaml
Normal file
7
kubernetes/capi-kustomize/base/kustomization.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- cluster.yaml
|
||||
- controlplane.yaml
|
||||
- workers.yaml
|
||||
53
kubernetes/capi-kustomize/base/workers.yaml
Normal file
53
kubernetes/capi-kustomize/base/workers.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
apiVersion: cluster.x-k8s.io/v1alpha2
|
||||
kind: MachineDeployment
|
||||
metadata:
|
||||
name: capi-quickstart-worker
|
||||
labels:
|
||||
cluster.x-k8s.io/cluster-name: capi-quickstart
|
||||
nodepool: nodepool-0
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
cluster.x-k8s.io/cluster-name: capi-quickstart
|
||||
nodepool: nodepool-0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
cluster.x-k8s.io/cluster-name: capi-quickstart
|
||||
nodepool: nodepool-0
|
||||
spec:
|
||||
version: v1.15.3
|
||||
bootstrap:
|
||||
configRef:
|
||||
name: capi-quickstart-worker
|
||||
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
|
||||
kind: KubeadmConfigTemplate
|
||||
infrastructureRef:
|
||||
name: capi-quickstart-worker
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSMachineTemplate
|
||||
---
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
|
||||
kind: AWSMachineTemplate
|
||||
metadata:
|
||||
name: capi-quickstart-worker
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
instanceType: t3.large
|
||||
iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io"
|
||||
sshKeyName: default
|
||||
---
|
||||
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha2
|
||||
kind: KubeadmConfigTemplate
|
||||
metadata:
|
||||
name: capi-quickstart-worker
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
joinConfiguration:
|
||||
nodeRegistration:
|
||||
name: '{{ ds.meta_data.hostname }}'
|
||||
kubeletExtraArgs:
|
||||
cloud-provider: aws
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../base
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../base
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../base
|
||||
Loading…
Reference in a new issue