Skip to content

Commit e357372

Browse files
tidied up docs, added metrics server
1 parent 2e903f6 commit e357372

File tree

5 files changed

+80
-47
lines changed

5 files changed

+80
-47
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ The initial strategy is to create a configuration to deploy the base cluster for
1313

1414
The [intial setup instructions](./docs/initial-setup.md) describe how to use and IaC solution that runs in Kubernetes to deploy itself. Thankfully this does not have to be done very often...
1515

16+
# Cluster Deployment #
17+
18+
The cluster deployments use kustomize to install the kubernetes cluster and components.
19+
20+
- Nofrixion specific [composite resource definitions (XRDs) and compositions](../apis/aws/) have beend defined to deploy a VPC and kubernetes cluster to AWS. The configuration is the same as those cluster initially deployed using `eksctl`
21+
- Cluster components (e.g. cluster autoscaler, nginx ingress controller, rabbitmq etc.) are deployed as seperate resources.
22+
23+
This approach improves modularity in terms of deploying clusters that require different components, or in the case of deploying to a different CSP, a different composition for the cluster can be created.
24+
25+
To deploy a cluster, create a kustomization.yaml file to deploy the following resouces to a specific namespace:
26+
27+
* a cluster claim, which calls the xrds and compositions to create a specific cluster instance. For example, the [it-ops-1 cluster](./it-ops-cluster/it-ops-cluster.yaml)
28+
* crossplane objects and releases to deploy additional components. `Objects` use the crossplane kubernetes provider to run the equivalent of `kubectl apply ...` and `Releases` use the helm provider to deploy helm charts.
29+
30+
1631
## Troubleshooting ##
1732

1833
### Deleting 'stuck' resources ###
@@ -26,6 +41,9 @@ kubectl patch $TARGET -p '{"metadata":{"finalizers": []}}' --type=merge
2641

2742
## REFERENCES ##
2843

44+
* Crossplane docs:
45+
* [Crossplane composite resource definitions (XRDs)](https://docs.crossplane.io/latest/concepts/composite-resource-definitions/)
46+
* [Crossplane compositions](https://docs.crossplane.io/latest/concepts/compositions/)
2947
* Anton Putra's [tutorial for creating VPC and deploying EKS](https://youtu.be/mpfqPXfX6mg?si=VK0LR-SfwYGGs6KO) - basically what we want but with only two subnet pairs instead of three.
3048
* [GitOps model for provisioning and bootstrapping Amazon EKS clusters using Crossplane and Argo CD](https://aws.amazon.com/blogs/containers/gitops-model-for-provisioning-and-bootstrapping-amazon-eks-clusters-using-crossplane-and-argo-cd/) - see section, `Amazon EKS cluster provisioning using Crossplane`
3149
* A video showing how to use a temporary local cluster to bootstrap [Crossplane to manage Crossplane](https://youtu.be/IlaYGgyg06o?si=mXM9p73MyrLCd8gA)
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#------------------------------------------------------------------------------
2+
#
3+
# Filename: helm-metrics-server.yaml
4+
#
5+
# Description: Crossplane helm provider release for kubernetes metrics server.
6+
#
7+
# Usage: Add as resource to kustomization.yaml for deployment.
8+
#
9+
# Author: James Bramich ([email protected])
10+
#
11+
# History:
12+
# 9 May 2024 James Bramich Created, Northdown, Tasmania, Australia.
13+
#-----------------------------------------------------------------------------
14+
apiVersion: helm.crossplane.io/v1beta1
15+
kind: Release
16+
metadata:
17+
name: metrics-server
18+
spec:
19+
forProvider:
20+
chart:
21+
name: metrics-server
22+
repository: https://kubernetes-sigs.github.io/metrics-server/
23+
version: 3.12.1
24+
namespace: kube-system
25+
providerConfigRef:
26+
name: clusterId-helm-provider

it-ops-cluster/it-ops-cluster.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ apiVersion: aws.nofrixion.com/v1alpha1
1313
kind: Cluster
1414
metadata:
1515
name: it-ops-1
16-
namespace: it-ops-cluster
1716
spec:
1817
compositeDeletePolicy: Foreground
1918
compositionUpdatePolicy: Automatic

it-ops-cluster/kustomization.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#------------------------------------------------------------------------------
2+
#
3+
# Filename: kustomization.yaml
4+
#
5+
# Description: Provides resources for it-ops-1 cluster.
6+
#
7+
# Usage: kubectl apply -k <PATH-TO-FOLDER-CONTAINING-THIS-FILE>
8+
#
9+
# Author: James Bramich ([email protected])
10+
#
11+
# History:
12+
# 9 May 2024 James Bramich Created, Northdown, Tasmania, Australia.
13+
#-----------------------------------------------------------------------------
14+
apiVersion: kustomize.config.k8s.io/v1beta1
15+
kind: Kustomization
16+
17+
namespace: it-ops-cluster
18+
19+
resources:
20+
- it-ops-cluster.yaml
21+
- helm-metrics-server.yaml
22+
23+
replacements:
24+
- source:
25+
kind: Cluster
26+
name: it-ops-1
27+
fieldPath: spec.parameters.id
28+
targets:
29+
- select:
30+
name: metrics-server
31+
kind: Release
32+
fieldPaths:
33+
- spec.providerConfigRef.name
34+
options:
35+
delimiter: "-"
36+
index: 0

test-manifests/entra-id-oidc-provider.yaml

-46
This file was deleted.

0 commit comments

Comments
 (0)