Skip to content

Commit

Permalink
[ATMOSPHERE-311] Add Ironic (#1711)
Browse files Browse the repository at this point in the history
This is an automated cherry-pick of #1697
/assign mnaser
  • Loading branch information
vexxhost-bot authored Jul 30, 2024
1 parent 16eff14 commit 3420f32
Show file tree
Hide file tree
Showing 158 changed files with 12,550 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ charts:
version: 4.10.1
repository:
url: https://kubernetes.github.io/ingress-nginx
- name: ironic
version: 0.2.14
repository: *openstack_helm_repository
dependencies: *openstack_helm_dependencies
- name: keycloak
version: 21.4.1
repository:
Expand Down
12 changes: 12 additions & 0 deletions charts/ironic/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Ironic
home: https://docs.openstack.org/ironic/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Ironic/OpenStack_Project_Ironic_vertical.png
maintainers:
- name: OpenStack-Helm Authors
name: ironic
sources:
- https://opendev.org/openstack/ironic
- https://opendev.org/openstack/openstack-helm
version: 0.2.14
12 changes: 12 additions & 0 deletions charts/ironic/charts/helm-toolkit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Helm-Toolkit
home: https://docs.openstack.org/openstack-helm
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
maintainers:
- name: OpenStack-Helm Authors
name: helm-toolkit
sources:
- https://opendev.org/openstack/openstack-helm-infra
- https://opendev.org/openstack/openstack-helm
version: 0.2.64
3 changes: 3 additions & 0 deletions charts/ironic/charts/helm-toolkit/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies: []
digest: sha256:643d5437104296e21d906ecb15b2c96ad278f20cfc4af53b12bb6069bd853726
generated: '0001-01-01T00:00:00Z'
15 changes: 15 additions & 0 deletions charts/ironic/charts/helm-toolkit/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
dependencies: []
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
abstract: |
Resolves database, or basic auth, style endpoints
values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
auth:
admin:
username: root
password: password
service_username:
username: username
password: password
hosts:
default: mariadb
host_fqdn_override:
default: null
path: /dbname
scheme: mysql+pymysql
port:
mysql:
default: 3306
usage: |
{{ tuple "oslo_db" "internal" "service_username" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" }}
return: |
mysql+pymysql://serviceuser:password@mariadb.default.svc.cluster.local:3306/dbname
*/}}

{{- define "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
{{- $type := index . 0 -}}
{{- $endpoint := index . 1 -}}
{{- $userclass := index . 2 -}}
{{- $port := index . 3 -}}
{{- $context := index . 4 -}}
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
{{- printf "%s://%s:%s@%s:%s%s" $endpointScheme $endpointUser $endpointPass $endpointHost $endpointPort $endpointPath -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
abstract: |
Resolves endpoint string suitible for use with oslo.messaging transport url
See: https://docs.openstack.org/oslo.messaging/latest/reference/transport.html#oslo_messaging.TransportURL
examples:
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_messaging:
auth:
cinder:
username: cinder
password: password
statefulset:
replicas: 2
name: rabbitmq-rabbitmq
hosts:
default: rabbitmq
host_fqdn_override:
default: null
path: /cinder
scheme: rabbit
port:
amqp:
default: 5672
usage: |
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
return: |
rabbit://cinder:password@rabbitmq-rabbitmq-0.rabbitmq.default.svc.cluster.local:5672,cinder:password@rabbitmq-rabbitmq-1.rabbitmq.default.svc.cluster.local:5672/cinder
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_messaging:
auth:
cinder:
username: cinder
password: password
statefulset: null
hosts:
default: rabbitmq
host_fqdn_override:
default: null
path: /cinder
scheme: rabbit
port:
amqp:
default: 5672
usage: |
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
return: |
rabbit://cinder:password@rabbitmq.default.svc.cluster.local:5672/cinder
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_messaging:
auth:
cinder:
username: cinder
password: password
statefulset:
replicas: 2
name: rabbitmq-rabbitmq
hosts:
default: rabbitmq
host_fqdn_override:
default: rabbitmq.openstackhelm.org
path: /cinder
scheme: rabbit
port:
amqp:
default: 5672
usage: |
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
return: |
rabbit://cinder:password@rabbitmq.openstackhelm.org:5672/cinder
*/}}

{{- define "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" -}}
{{- $type := index . 0 -}}
{{- $endpoint := index . 1 -}}
{{- $userclass := index . 2 -}}
{{- $port := index . 3 -}}
{{- $context := index . 4 -}}
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
{{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}}
{{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }}
{{- $endpointUser := index $userMap "username" }}
{{- $endpointPass := index $userMap "password" }}
{{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- $local := dict "endpointCredsAndHosts" list -}}
{{- if not (or (index $hostFqdnOverride $endpoint | default ( index $hostFqdnOverride "default" ) ) ( not $ssMap ) ) }}
{{- $endpointHostPrefix := $ssMap.name }}
{{- range $podInt := until ( atoi (print $ssMap.replicas ) ) }}
{{- $endpointCredAndHost := printf "%s:%s@%s-%d.%s:%s" $endpointUser $endpointPass $endpointHostPrefix $podInt $endpointHostSuffix $endpointPort }}
{{- $_ := set $local "endpointCredsAndHosts" ( append $local.endpointCredsAndHosts $endpointCredAndHost ) }}
{{- end }}
{{- else }}
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
{{- $endpointCredAndHost := printf "%s:%s@%s:%s" $endpointUser $endpointPass $endpointHost $endpointPort }}
{{- $_ := set $local "endpointCredsAndHosts" ( append $local.endpointCredsAndHosts $endpointCredAndHost ) }}
{{- end }}
{{- $endpointCredsAndHosts := include "helm-toolkit.utils.joinListWithComma" $local.endpointCredsAndHosts }}
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
{{- printf "%s://%s%s" $endpointScheme $endpointCredsAndHosts $endpointPath }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
abstract: |
Resolves either the fully qualified hostname, of if defined in the host field
IPv4 for an endpoint.
examples:
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
hosts:
default: mariadb
host_fqdn_override:
default: null
usage: |
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
return: |
mariadb.default.svc.cluster.local
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
hosts:
default:
host: mariadb
host_fqdn_override:
default: null
usage: |
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
return: |
mariadb.default.svc.cluster.local
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
hosts:
default: 127.0.0.1
host_fqdn_override:
default: null
usage: |
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
return: |
127.0.0.1
- values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
hosts:
default:
host: 127.0.0.1
host_fqdn_override:
default: null
usage: |
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
return: |
127.0.0.1
*/}}

{{- define "helm-toolkit.endpoints.endpoint_host_lookup" -}}
{{- $type := index . 0 -}}
{{- $endpoint := index . 1 -}}
{{- $context := index . 2 -}}
{{- $endpointMap := index $context.Values.endpoints ( $type | replace "-" "_" ) }}
{{- $endpointScheme := $endpointMap.scheme }}
{{- $_ := set $context.Values "__endpointHost" ( index $endpointMap.hosts $endpoint | default $endpointMap.hosts.default ) }}
{{- if kindIs "map" $context.Values.__endpointHost }}
{{- $_ := set $context.Values "__endpointHost" ( index $context.Values.__endpointHost "host" ) }}
{{- end }}
{{- $endpointHost := $context.Values.__endpointHost }}
{{- if regexMatch "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" $endpointHost }}
{{- $endpointHostname := printf "%s" $endpointHost }}
{{- printf "%s" $endpointHostname -}}
{{- else }}
{{- $endpointHostname := tuple $type $endpoint $context | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
{{- printf "%s" $endpointHostname -}}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{/*
abstract: |
Resolves the port for an endpoint
values: |
endpoints:
cluster_domain_suffix: cluster.local
oslo_db:
port:
mysql:
default: 3306
usage: |
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
return: |
3306
*/}}

{{- define "helm-toolkit.endpoints.endpoint_port_lookup" -}}
{{- $type := index . 0 -}}
{{- $endpoint := index . 1 -}}
{{- $port := index . 2 -}}
{{- $context := index . 3 -}}
{{- $typeYamlSafe := $type | replace "-" "_" }}
{{- $endpointMap := index $context.Values.endpoints $typeYamlSafe }}
{{- $endpointPortMAP := index $endpointMap.port $port }}
{{- $endpointPort := index $endpointPortMAP $endpoint | default ( index $endpointPortMAP "default" ) }}
{{- printf "%1.f" $endpointPort -}}
{{- end -}}
Loading

0 comments on commit 3420f32

Please sign in to comment.