-
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 OpenStack standalone control plane Helm chart and templates
Signed-off-by: Bharath Nallapeta <[email protected]>
- Loading branch information
1 parent
6dd525c
commit dd6b323
Showing
14 changed files
with
804 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: hmc.mirantis.com/v1alpha1 | ||
kind: ManagedCluster | ||
metadata: | ||
name: openstack-dev | ||
namespace: ${NAMESPACE} | ||
spec: | ||
template: openstack-standalone-cp-0-0-1 | ||
credential: openstack-cluster-identity-cred | ||
config: | ||
controlPlaneNumber: 1 | ||
workersNumber: 1 | ||
controlPlane: | ||
flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} | ||
image: | ||
filter: | ||
name: ${OPENSTACK_IMAGE_NAME} | ||
worker: | ||
flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} | ||
image: | ||
filter: | ||
name: ${OPENSTACK_IMAGE_NAME} | ||
authURL: ${OS_AUTH_URL} |
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,19 @@ | ||
apiVersion: v2 | ||
name: openstack-standalone-cp | ||
description: | | ||
An HMC 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/openstack-standalone-cp/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 }} |
17 changes: 17 additions & 0 deletions
17
templates/cluster/openstack-standalone-cp/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,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/v1beta1 | ||
kind: K0sControlPlane | ||
name: {{ include "k0scontrolplane.name" . }} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackCluster | ||
name: {{ include "cluster.name" . }} |
80 changes: 80 additions & 0 deletions
80
templates/cluster/openstack-standalone-cp/templates/k0scontrolplane.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,80 @@ | ||
apiVersion: controlplane.cluster.x-k8s.io/v1beta1 | ||
kind: K0sControlPlane | ||
metadata: | ||
name: {{ include "k0scontrolplane.name" . }} | ||
spec: | ||
k0sConfigSpec: | ||
args: | ||
- --enable-worker | ||
- --enable-cloud-provider | ||
- --kubelet-extra-args="--cloud-provider=external" | ||
- --disable-components=konnectivity-server | ||
k0s: | ||
apiVersion: k0s.k0sproject.io/v1beta1 | ||
kind: ClusterConfig | ||
metadata: | ||
name: k0s | ||
spec: | ||
api: | ||
extraArgs: | ||
anonymous-auth: "true" | ||
extensions: | ||
helm: | ||
repositories: | ||
- name: openstack | ||
url: https://kubernetes.github.io/cloud-provider-openstack/ | ||
charts: | ||
- name: openstack-ccm | ||
chartname: openstack/openstack-cloud-controller-manager | ||
version: 2.31.1 | ||
order: 1 | ||
namespace: kube-system | ||
values: | | ||
secret: | ||
enabled: true | ||
name: openstack-cloud-config | ||
create: false | ||
nodeSelector: | ||
node-role.kubernetes.io/control-plane: "true" | ||
tolerations: | ||
- key: node.cloudprovider.kubernetes.io/uninitialized | ||
value: "true" | ||
effect: NoSchedule | ||
- key: node-role.kubernetes.io/control-plane | ||
effect: NoSchedule | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
- name: openstack-csi | ||
chartname: openstack/openstack-cinder-csi | ||
version: 2.31.2 | ||
order: 2 | ||
namespace: kube-system | ||
values: | | ||
storageClass: | ||
enabled: true | ||
delete: | ||
isDefault: false | ||
allowVolumeExpansion: true | ||
retain: | ||
isDefault: false | ||
allowVolumeExpansion: false | ||
secret: | ||
enabled: true | ||
name: openstack-cloud-config | ||
create: false | ||
csi: | ||
plugin: | ||
nodePlugin: | ||
kubeletDir: /var/lib/k0s/kubelet | ||
network: | ||
provider: calico | ||
calico: | ||
mode: vxlan | ||
machineTemplate: | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackMachineTemplate | ||
name: {{ include "openstackmachinetemplate.controlplane.name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
replicas: {{ .Values.controlPlaneNumber }} | ||
version: {{ .Values.k0s.version }} |
11 changes: 11 additions & 0 deletions
11
templates/cluster/openstack-standalone-cp/templates/k0sworkerconfigtemplate.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,11 @@ | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: K0sWorkerConfigTemplate | ||
metadata: | ||
name: {{ include "k0sworkerconfigtemplate.name" . }} | ||
spec: | ||
template: | ||
spec: | ||
args: | ||
- --enable-cloud-provider | ||
- --kubelet-extra-args="--cloud-provider=external" | ||
version: {{ .Values.k0s.version }} |
25 changes: 25 additions & 0 deletions
25
templates/cluster/openstack-standalone-cp/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,25 @@ | ||
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: | ||
bootstrap: | ||
configRef: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: K0sWorkerConfigTemplate | ||
name: {{ include "k0sworkerconfigtemplate.name" . }} | ||
clusterName: {{ include "cluster.name" . }} | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackMachineTemplate | ||
name: {{ include "openstackmachinetemplate.worker.name" . }} |
32 changes: 32 additions & 0 deletions
32
templates/cluster/openstack-standalone-cp/templates/openstackcluster.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,32 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackCluster | ||
metadata: | ||
name: {{ include "cluster.name" . }} | ||
spec: | ||
{{- if .Values.apiServerLoadBalancer }} | ||
apiServerLoadBalancer: | ||
{{- toYaml .Values.apiServerLoadBalancer | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.bastion.enabled }} | ||
bastion: | ||
{{- with .Values.bastion.spec }} | ||
spec: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Values.externalNetwork }} | ||
externalNetwork: | ||
{{- toYaml .Values.externalNetwork | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.identityRef }} | ||
identityRef: | ||
name: {{ .Values.identityRef.name }} | ||
cloudName: {{ .Values.identityRef.cloudName | default "openstack" }} | ||
region: {{ .Values.identityRef.region | default "RegionOne" }} | ||
{{- end }} | ||
managedSecurityGroups: | ||
{{- toYaml .Values.managedSecurityGroups | nindent 4 }} | ||
{{- if .Values.managedSubnets }} | ||
managedSubnets: | ||
{{- toYaml .Values.managedSubnets | nindent 4 }} | ||
{{- end }} |
32 changes: 32 additions & 0 deletions
32
...ates/cluster/openstack-standalone-cp/templates/openstackmachinetemplate-controlplane.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,32 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: {{ include "openstackmachinetemplate.controlplane.name" . }} | ||
spec: | ||
template: | ||
spec: | ||
flavor: {{ .Values.controlplane.flavor }} | ||
identityRef: | ||
name: {{ .Values.identityRef.name }} | ||
region: {{ .Values.identityRef.region }} | ||
cloudName: {{ .Values.identityRef.cloudName}} | ||
image: | ||
filter: | ||
name: {{ .Values.controlplane.image.filter.name }} | ||
{{- if .Values.controlplane.image.filter.tags }} | ||
tags: | ||
{{- range $tag := .Values.controlplane.image.filter.tags }} | ||
- {{ $tag }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if gt (len .Values.controlplane.portOpts) 0 }} | ||
portOpts: | ||
{{ .Values.controlplane.portOpts | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- if gt (len .Values.controlplane.securityGroups) 0 }} | ||
securityGroups: | ||
{{ .Values.controlplane.securityGroups | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- if not ( .Values.controlplane.sshPublicKey | empty) }} | ||
sshKeyName: {{ .Values.controlplane.sshPublicKey }} | ||
{{- end }} |
32 changes: 32 additions & 0 deletions
32
templates/cluster/openstack-standalone-cp/templates/openstackmachinetemplate-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,32 @@ | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: OpenStackMachineTemplate | ||
metadata: | ||
name: {{ include "openstackmachinetemplate.worker.name" . }} | ||
spec: | ||
template: | ||
spec: | ||
flavor: {{ .Values.worker.flavor }} | ||
identityRef: | ||
name: {{ .Values.identityRef.name }} | ||
region: {{ .Values.identityRef.region }} | ||
cloudName: {{ .Values.identityRef.cloudName}} | ||
image: | ||
filter: | ||
name: {{ .Values.worker.image.filter.name }} | ||
{{- if .Values.worker.image.filter.tags }} | ||
tags: | ||
{{- range $tag := .Values.worker.image.filter.tags }} | ||
- {{ $tag }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if gt (len .Values.worker.portOpts) 0 }} | ||
portOpts: | ||
{{ .Values.worker.portOpts | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- if gt (len .Values.worker.securityGroups) 0 }} | ||
securityGroups: | ||
{{ .Values.worker.securityGroups | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- if not ( .Values.worker.sshPublicKey | empty) }} | ||
sshKeyName: {{ .Values.worker.sshPublicKey }} | ||
{{- end }} |
Oops, something went wrong.