forked from k0rdent/kcm
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
16 changed files
with
360 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
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,11 @@ | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: ManagedCluster | ||
metadata: | ||
name: eks-dev | ||
namespace: ${NAMESPACE} | ||
spec: | ||
config: | ||
region: us-east-2 | ||
workersNumber: 1 | ||
template: aws-eks-0-0-1 | ||
credential: "aws-cluster-identity-cred" |
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
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,13 @@ | ||
apiVersion: v2 | ||
name: aws-eks | ||
description: | | ||
An HMC template to deploy a cluster on EKS with bootstrapped control plane nodes. | ||
type: application | ||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.0.1 | ||
annotations: | ||
hmc.mirantis.com/infrastructure-providers: aws | ||
hmc.mirantis.com/controlplane-providers: eks | ||
hmc.mirantis.com/bootstrap-providers: eks |
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,19 @@ | ||
{{- define "cluster.name" -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{- define "awsmachinetemplate.worker.name" -}} | ||
{{- include "cluster.name" . }}-worker-mt | ||
{{- end }} | ||
|
||
{{- define "machinedeployment.name" -}} | ||
{{- include "cluster.name" . }}-md | ||
{{- end }} | ||
|
||
{{- define "awsmanagedcontrolplane.name" -}} | ||
{{- include "cluster.name" . }}-cp | ||
{{- end }} | ||
|
||
{{- define "eksconfigtemplate.name" -}} | ||
{{- include "cluster.name" . }}-machine-config | ||
{{- end }} |
22 changes: 22 additions & 0 deletions
22
templates/cluster/aws-eks/templates/awsmachinetemplate-worker.yaml
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,22 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSMachineTemplate | ||
metadata: | ||
name: {{ include "awsmachinetemplate.worker.name" . }} | ||
spec: | ||
template: | ||
spec: | ||
{{- if not (quote .Values.worker.amiID | empty) }} | ||
ami: | ||
id: {{ .Values.worker.amiID }} | ||
{{- end }} | ||
imageLookupFormat: {{ .Values.worker.imageLookup.format }} | ||
imageLookupOrg: {{ .Values.worker.imageLookup.org }} | ||
imageLookupBaseOS: {{ .Values.worker.imageLookup.baseOS }} | ||
instanceType: {{ .Values.worker.instanceType }} | ||
iamInstanceProfile: {{ .Values.worker.iamInstanceProfile }} | ||
publicIP: {{ .Values.publicIP }} | ||
rootVolume: | ||
size: {{ .Values.worker.rootVolumeSize }} | ||
{{- if not (quote .Values.sshKeyName | empty) }} | ||
sshKeyName: {{ .Values.sshKeyName | quote }} | ||
{{- end }} |
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,7 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSManagedCluster | ||
metadata: | ||
name: {{ include "cluster.name" . }} | ||
annotations: | ||
aws.cluster.x-k8s.io/external-resource-gc: "true" | ||
spec: {} |
14 changes: 14 additions & 0 deletions
14
templates/cluster/aws-eks/templates/awsmanagedcontrolplane.yaml
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,14 @@ | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta2 | ||
kind: AWSManagedControlPlane | ||
metadata: | ||
name: {{ include "awsmanagedcontrolplane.name" . }} | ||
namespace: hmc-system | ||
spec: | ||
region: {{ .Values.region }} | ||
{{- if not (quote .Values.sshKeyName | empty) }} | ||
sshKeyName: {{ .Values.sshKeyName | quote }} | ||
{{- end }} | ||
version: {{ .Values.kubernetes.version }} | ||
identityRef: | ||
kind: {{ .Values.clusterIdentity.kind }} | ||
name: {{ .Values.clusterIdentity.name }} |
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 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: {{ include "cluster.name" . }} | ||
spec: | ||
{{- with .Values.clusterNetwork }} | ||
clusterNetwork: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
controlPlaneRef: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta2 | ||
kind: AWSManagedControlPlane | ||
name: {{ include "awsmanagedcontrolplane.name" . }} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSManagedCluster | ||
name: {{ include "cluster.name" . }} |
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,6 @@ | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 | ||
kind: EKSConfigTemplate | ||
metadata: | ||
name: {{ include "eksconfigtemplate.name" . }} | ||
spec: | ||
template: {} |
26 changes: 26 additions & 0 deletions
26
templates/cluster/aws-eks/templates/machinedeployment.yaml
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,26 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: {{ include "machinedeployment.name" . }} | ||
spec: | ||
clusterName: {{ include "cluster.name" . }} | ||
replicas: {{ .Values.workersNumber }} | ||
selector: | ||
matchLabels: | ||
cluster.x-k8s.io/cluster-name: {{ include "cluster.name" . }} | ||
template: | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: {{ include "cluster.name" . }} | ||
spec: | ||
version: {{ .Values.kubernetes.version }} | ||
clusterName: {{ include "cluster.name" . }} | ||
bootstrap: | ||
configRef: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 | ||
kind: EKSConfigTemplate | ||
name: {{ include "eksconfigtemplate.name" . }} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSMachineTemplate | ||
name: {{ include "awsmachinetemplate.worker.name" . }} |
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,146 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "An HMC template to deploy a ManagedCluster on EKS.", | ||
"type": "object", | ||
"required": [ | ||
"workersNumber", | ||
"region", | ||
"clusterIdentity" | ||
], | ||
"properties": { | ||
"workersNumber": { | ||
"description": "The number of the worker machines", | ||
"type": "number", | ||
"minimum": 1 | ||
}, | ||
"clusterNetwork": { | ||
"type": "object", | ||
"properties": { | ||
"pods": { | ||
"type": "object", | ||
"properties": { | ||
"cidrBlocks": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
} | ||
}, | ||
"services": { | ||
"type": "object", | ||
"properties": { | ||
"cidrBlocks": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"region": { | ||
"description": "AWS region to deploy the cluster in", | ||
"type": "string" | ||
}, | ||
"sshKeyName": { | ||
"description": "The name of the key pair to securely connect to your instances. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"publicIP": { | ||
"description": "Specifies whether the instance should get a public IP", | ||
"type": "boolean" | ||
}, | ||
"clusterIdentity": { | ||
"type": "object", | ||
"description": "AWS Cluster Identity object reference", | ||
"required": [ | ||
"name", | ||
"kind" | ||
], | ||
"properties": { | ||
"name": { | ||
"description": "AWS ClusterIdentity object name", | ||
"type": "string" | ||
}, | ||
"kind": { | ||
"description": "AWS ClusterIdentity object kind", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"worker": { | ||
"description": "The configuration of the worker machines", | ||
"type": "object", | ||
"required": [ | ||
"iamInstanceProfile", | ||
"instanceType" | ||
], | ||
"properties": { | ||
"amiID": { | ||
"description": "The ID of Amazon Machine Image", | ||
"type": "string" | ||
}, | ||
"iamInstanceProfile": { | ||
"description": "The name of an IAM instance profile to assign to the instance", | ||
"type": "string" | ||
}, | ||
"instanceType": { | ||
"description": "The type of instance to create", | ||
"type": "string" | ||
}, | ||
"additionalSecurityGroupIDs": { | ||
"description": "An array of references to security groups that should be applied to the instance", | ||
"type": "array" | ||
}, | ||
"rootVolumeSize": { | ||
"description": "The size of the root volume of the instance (GB)", | ||
"type": "integer" | ||
}, | ||
"imageLookup": { | ||
"description": "AMI lookup parameters", | ||
"type": "object", | ||
"required": [ | ||
"format", | ||
"org" | ||
], | ||
"properties": { | ||
"format": { | ||
"description": "Format string which will be used for image lookup", | ||
"type": "string" | ||
}, | ||
"org": { | ||
"description": "AWS org ID which owns the AMI", | ||
"type": "string" | ||
}, | ||
"baseOS": { | ||
"description": "OS name which can be used in format string", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"kubernetes": { | ||
"description": "Kubernetes parameters", | ||
"type": "object", | ||
"required": [ | ||
"version" | ||
], | ||
"properties": { | ||
"version": { | ||
"description": "Kubernetes version to use", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,34 @@ | ||
# Cluster parameters | ||
workersNumber: 1 | ||
|
||
clusterNetwork: | ||
pods: | ||
cidrBlocks: | ||
- "10.244.0.0/16" | ||
services: | ||
cidrBlocks: | ||
- "10.96.0.0/12" | ||
|
||
# EKS cluster parameters | ||
region: "" | ||
sshKeyName: "" | ||
publicIP: false | ||
|
||
clusterIdentity: | ||
name: "aws-cluster-identity" | ||
kind: "AWSClusterStaticIdentity" | ||
|
||
# EKS machines parameters | ||
worker: | ||
amiID: "" | ||
iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io | ||
instanceType: "t3.small" | ||
rootVolumeSize: 30 | ||
imageLookup: | ||
format: "" | ||
org: "" | ||
baseOS: "" | ||
|
||
# Kubernetes version | ||
kubernetes: | ||
version: v1.30.4 |
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
10 changes: 10 additions & 0 deletions
10
templates/provider/hmc-templates/files/templates/aws-eks-0-0-1.yaml
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,10 @@ | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: ClusterTemplate | ||
metadata: | ||
name: aws-eks-0-0-1 | ||
annotations: | ||
helm.sh/resource-policy: keep | ||
spec: | ||
helm: | ||
chartName: aws-eks | ||
chartVersion: 0.0.1 |