-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from wkonitzer/openstack-only
Additions to add OpenStack support
- Loading branch information
Showing
31 changed files
with
1,895 additions
and
14 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,36 @@ | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterDeployment | ||
metadata: | ||
name: ${NAMESPACE}-openstack-${CLUSTERNAME}${UNIQUE_SUFFIX} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: demo-openstack-standalone-cp-0.0.1 | ||
credential: openstack-cluster-identity-cred | ||
config: | ||
clusterLabels: | ||
k0rdent: demo | ||
controlPlaneNumber: 1 | ||
workersNumber: 2 | ||
controlplane: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
worker: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
externalNetwork: | ||
filter: | ||
name: public | ||
authURL: ${OS_AUTH_URL} | ||
identityRef: | ||
name: openstack-cloud-config | ||
cloudName: openstack | ||
region: RegionOne | ||
serviceSpec: | ||
services: | ||
- template: demo-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,31 @@ | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterDeployment | ||
metadata: | ||
name: ${NAMESPACE}-openstack-${CLUSTERNAME}${UNIQUE_SUFFIX} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: demo-openstack-standalone-cp-0.0.1 | ||
credential: openstack-cluster-identity-cred | ||
config: | ||
clusterLabels: | ||
k0rdent: demo | ||
controlPlaneNumber: 1 | ||
workersNumber: 2 | ||
controlplane: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
worker: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
externalNetwork: | ||
filter: | ||
name: public | ||
authURL: ${OS_AUTH_URL} | ||
identityRef: | ||
name: openstack-cloud-config | ||
cloudName: openstack | ||
region: RegionOne |
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,38 @@ | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterDeployment | ||
metadata: | ||
name: ${NAMESPACE}-openstack-${CLUSTERNAME}${UNIQUE_SUFFIX} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: demo-openstack-standalone-cp-0.0.2 | ||
credential: openstack-cluster-identity-cred | ||
config: | ||
clusterLabels: | ||
k0rdent: demo | ||
clusterLabels: | ||
k0rdent: demo | ||
controlPlaneNumber: 1 | ||
workersNumber: 2 | ||
controlplane: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
worker: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
externalNetwork: | ||
filter: | ||
name: public | ||
authURL: ${OS_AUTH_URL} | ||
identityRef: | ||
name: openstack-cloud-config | ||
cloudName: openstack | ||
region: RegionOne | ||
serviceSpec: | ||
services: | ||
- template: demo-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,31 @@ | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterDeployment | ||
metadata: | ||
name: ${NAMESPACE}-openstack-${CLUSTERNAME}${UNIQUE_SUFFIX} | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: demo-openstack-standalone-cp-0.0.2 | ||
credential: openstack-cluster-identity-cred | ||
config: | ||
clusterLabels: | ||
k0rdent: demo | ||
controlPlaneNumber: 1 | ||
workersNumber: 2 | ||
controlplane: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
worker: | ||
flavor: m1.medium | ||
image: | ||
filter: | ||
name: ubuntu-22.04 | ||
externalNetwork: | ||
filter: | ||
name: public | ||
authURL: ${OS_AUTH_URL} | ||
identityRef: | ||
name: openstack-cloud-config | ||
cloudName: openstack | ||
region: RegionOne |
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,32 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: openstack-cloud-config | ||
namespace: k0rdent | ||
type: Opaque | ||
stringData: | ||
clouds.yaml: | | ||
clouds: | ||
openstack: | ||
auth: | ||
auth_url: ${OS_AUTH_URL} | ||
application_credential_id: ${OS_APPLICATION_CREDENTIAL_ID} | ||
application_credential_secret: ${OS_APPLICATION_CREDENTIAL_SECRET} | ||
region_name: RegionOne | ||
interface: public | ||
identity_api_version: 3 | ||
auth_type: v3applicationcredential | ||
--- | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: Credential | ||
metadata: | ||
name: openstack-cluster-identity-cred | ||
namespace: ${TESTING_NAMESPACE} | ||
spec: | ||
description: OpenStack credentials | ||
identityRef: | ||
apiVersion: v1 | ||
kind: Secret | ||
name: openstack-cloud-config | ||
namespace: ${TESTING_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterTemplate | ||
metadata: | ||
name: demo-openstack-standalone-cp-0.0.1 | ||
namespace: ${NAMESPACE} | ||
spec: | ||
helm: | ||
chartSpec: | ||
chart: demo-openstack-standalone-cp | ||
version: 0.0.1 | ||
interval: 10m0s | ||
sourceRef: | ||
kind: HelmRepository | ||
name: k0rdent-demos | ||
--- | ||
apiVersion: k0rdent.mirantis.com/v1alpha1 | ||
kind: ClusterTemplateChain | ||
metadata: | ||
name: demo-openstack-standalone-cp-0.0.1 | ||
namespace: ${NAMESPACE} | ||
spec: | ||
supportedTemplates: | ||
- name: demo-openstack-standalone-cp-0.0.1 |
19 changes: 19 additions & 0 deletions
19
templates/cluster/demo-openstack-standalone-cp-0.0.1/Chart.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,19 @@ | ||
apiVersion: v2 | ||
name: demo-openstack-standalone-cp | ||
description: | | ||
A KCM template to deploy a k0s cluster on OpenStack 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 | ||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.31.1+k0s.1" | ||
annotations: | ||
cluster.x-k8s.io/provider: infrastructure-openstack, control-plane-k0smotron, bootstrap-k0smotron | ||
cluster.x-k8s.io/bootstrap-k0smotron: v1beta1 | ||
cluster.x-k8s.io/control-plane-k0smotron: v1beta1 | ||
cluster.x-k8s.io/infrastructure-openstack: v1beta1 |
23 changes: 23 additions & 0 deletions
23
templates/cluster/demo-openstack-standalone-cp-0.0.1/templates/_helpers.tpl
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 @@ | ||
{{- define "cluster.name" -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{- define "openstackmachinetemplate.controlplane.name" -}} | ||
{{- include "cluster.name" . }}-cp-mt | ||
{{- end }} | ||
|
||
{{- define "openstackmachinetemplate.worker.name" -}} | ||
{{- include "cluster.name" . }}-worker-mt | ||
{{- end }} | ||
|
||
{{- define "k0scontrolplane.name" -}} | ||
{{- include "cluster.name" . }}-cp | ||
{{- end }} | ||
|
||
{{- define "k0sworkerconfigtemplate.name" -}} | ||
{{- include "cluster.name" . }}-machine-config | ||
{{- end }} | ||
|
||
{{- define "machinedeployment.name" -}} | ||
{{- include "cluster.name" . }}-md | ||
{{- end }} |
20 changes: 20 additions & 0 deletions
20
templates/cluster/demo-openstack-standalone-cp-0.0.1/templates/cluster.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,20 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: {{ include "cluster.name" . }} | ||
{{- if .Values.clusterLabels }} | ||
labels: {{- toYaml .Values.clusterLabels | nindent 4}} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.clusterNetwork }} | ||
clusterNetwork: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
controlPlaneRef: | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: K0sControlPlane | ||
name: {{ include "k0scontrolplane.name" . }} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackCluster | ||
name: {{ include "cluster.name" . }} |
Oops, something went wrong.