Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenStack provider support with configuration and templates #695

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const (
ProviderAzureName = "cluster-api-provider-azure"
// Provider vSphere
ProviderVSphereName = "cluster-api-provider-vsphere"
// Provider OpenStack
ProviderOpenStackName = "cluster-api-provider-openstack"
// Provider K0smotron
ProviderK0smotronName = "k0smotron"
// Provider Sveltos
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/management_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func GetDefaultProviders() []Provider {
{Name: ProviderAWSName},
{Name: ProviderAzureName},
{Name: ProviderVSphereName},
{Name: ProviderOpenStackName},
{Name: ProviderSveltosName},
}
}
Expand Down
23 changes: 23 additions & 0 deletions templates/provider/cluster-api-provider-openstack/.helmignore
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/
24 changes: 24 additions & 0 deletions templates/provider/cluster-api-provider-openstack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: cluster-api-provider-openstack
description: A Helm chart for Cluster API provider OpenStack
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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: "v0.11.3"
annotations:
cluster.x-k8s.io/provider: infrastructure-openstack
cluster.x-k8s.io/v1beta1: v1beta1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: openstack
spec:
version: v0.11.3
{{- if .Values.configSecret.name }}
configSecret:
name: {{ .Values.configSecret.name }}
namespace: {{ .Values.configSecret.namespace | default .Release.Namespace | trunc 63 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if and .Values.configSecret.create .Values.configSecret.name }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.configSecret.name }}
namespace: {{ .Values.configSecret.namespace | default .Release.Namespace | trunc 63 }}
stringData:
{{ toYaml .Values.config | indent 2 }}
bnallapeta marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Schema for configuration secret settings used in the OpenStack deployment.",
"type": "object",
"required": [
"configSecret"
],
"properties": {
"configSecret": {
"type": "object",
"description": "Settings for the OpenStack configuration secret.",
"required": [
"create",
"name"
],
"properties": {
"create": {
"type": "boolean",
"description": "Indicates whether a new secret should be created."
},
"name": {
"type": "string",
"description": "The name of the OpenStack configuration secret."
},
"namespace": {
"type": "string",
"description": "The namespace where the OpenStack configuration secret will be created or referenced."
}
}
},
"config": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
configSecret:
create: false
name: ""
namespace: ""

config: {}
2 changes: 2 additions & 0 deletions templates/provider/hmc-templates/files/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ spec:
template: cluster-api-provider-vsphere-0-0-4
- name: cluster-api-provider-aws
template: cluster-api-provider-aws-0-0-4
- name: cluster-api-provider-openstack
template: cluster-api-provider-openstack-0-0-1
- name: projectsveltos
template: projectsveltos-0-44-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: hmc.mirantis.com/v1alpha1
kind: ProviderTemplate
metadata:
name: cluster-api-provider-openstack-0-0-1
annotations:
helm.sh/resource-policy: keep
spec:
bnallapeta marked this conversation as resolved.
Show resolved Hide resolved
helm:
chartSpec:
chart: cluster-api-provider-openstack
version: 0.0.1
interval: 10m0s
sourceRef:
kind: HelmRepository
name: hmc-templates
Loading