-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add adopted cluster template to adopt existing k8s clusters
- Loading branch information
1 parent
1070b58
commit f96ce95
Showing
18 changed files
with
428 additions
and
21 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
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,16 @@ | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: ClusterDeployment | ||
metadata: | ||
name: adopted-dev | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: adopted-cluster-0-0-1 | ||
credential: adopted-cluster-cred | ||
config: {} | ||
services: | ||
- template: kyverno-3-2-6 | ||
name: kyverno | ||
namespace: kyverno | ||
- template: ingress-nginx-4-11-0 | ||
name: ingress-nginx | ||
namespace: ingress-nginx |
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,21 @@ | ||
apiVersion: v1 | ||
data: | ||
value: ${KUBECONFIG_DATA} | ||
kind: Secret | ||
metadata: | ||
name: adopted-cluster-kubeconf | ||
namespace: ${NAMESPACE} | ||
type: Opaque | ||
--- | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: Credential | ||
metadata: | ||
name: adopted-cluster-cred | ||
namespace: ${NAMESPACE} | ||
spec: | ||
description: Adopted Credentials | ||
identityRef: | ||
apiVersion: v1 | ||
kind: Secret | ||
name: adopted-cluster-kubeconf | ||
namespace: ${NAMESPACE} |
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
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,11 @@ | ||
apiVersion: v2 | ||
name: adopted-cluster | ||
description: | | ||
An HMC template to adopt an already existing kubernetes cluster | ||
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: | ||
cluster.x-k8s.io/provider: infrastructure-internal |
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,4 @@ | ||
{{- define "cluster.name" -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
7 changes: 7 additions & 0 deletions
7
templates/cluster/adopted-cluster/templates/sveltoscluster.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,7 @@ | ||
apiVersion: lib.projectsveltos.io/v1beta1 | ||
kind: SveltosCluster | ||
metadata: | ||
name: {{ include "cluster.name" . }} | ||
spec: | ||
consecutiveFailureThreshold: {{ .Values.consecutiveFailureThreshold }} | ||
kubeconfigName: {{ .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,15 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "An HMC template to adopt an existing k8s cluster.", | ||
"type": "object", | ||
"required": [ | ||
"clusterIdentity" | ||
], | ||
"properties": { | ||
"consecutiveFailureThreshold": { | ||
"description": "The number of the failures prior to setting the status condition", | ||
"type": "integer", | ||
"minimum": 1 | ||
} | ||
} | ||
} |
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 @@ | ||
# Cluster parameters | ||
|
||
clusterIdentity: | ||
name: "adopted-cluster-identity" | ||
|
||
consecutiveFailureThreshold: 3 |
15 changes: 15 additions & 0 deletions
15
templates/provider/hmc-templates/files/templates/adopted-cluster-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,15 @@ | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: ClusterTemplate | ||
metadata: | ||
name: adopted-cluster-0-0-1 | ||
annotations: | ||
helm.sh/resource-policy: keep | ||
spec: | ||
helm: | ||
chartSpec: | ||
chart: adopted-cluster | ||
version: 0.0.1 | ||
interval: 10m0s | ||
sourceRef: | ||
kind: HelmRepository | ||
name: hmc-templates |
Oops, something went wrong.