Skip to content

Commit 23344c2

Browse files
add masakari (#1)
1 parent 5c3aad5 commit 23344c2

163 files changed

Lines changed: 12339 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

charts/masakari/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/masakari/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: helm-toolkit
3+
repository: file://../../openstack-helm-infra/helm-toolkit
4+
version: 2024.2.0
5+
digest: sha256:c7a58b17e9e684f6cecff16ec0974cf93c379f21414a16da4a1b36f49a618e82
6+
generated: "2024-12-24T16:14:48.900349987Z"

charts/masakari/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
appVersion: v1.0.0
3+
dependencies:
4+
- name: helm-toolkit
5+
repository: file://../../openstack-helm-infra/helm-toolkit
6+
version: '>= 0.1.0'
7+
description: OpenStack-Helm Masakari
8+
home: https://docs.openstack.org/developer/masakari
9+
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Masakari/OpenStack_Project_masakari_vertical.png
10+
maintainers:
11+
- name: OpenStack-Helm Authors
12+
name: masakari
13+
sources:
14+
- https://opendev.org/openstack/masakari
15+
- https://opendev.org/openstack/masakari-monitors
16+
- https://opendev.org/openstack/openstack-helm
17+
version: 2024.2.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
appVersion: v1.0.0
3+
description: OpenStack-Helm Helm-Toolkit
4+
home: https://docs.openstack.org/openstack-helm
5+
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
6+
maintainers:
7+
- name: OpenStack-Helm Authors
8+
name: helm-toolkit
9+
sources:
10+
- https://opendev.org/openstack/openstack-helm-infra
11+
- https://opendev.org/openstack/openstack-helm
12+
version: 0.2.69
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies: []
2+
digest: sha256:643d5437104296e21d906ecb15b2c96ad278f20cfc4af53b12bb6069bd853726
3+
generated: "0001-01-01T00:00:00Z"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
---
14+
dependencies: []
15+
...
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{/*
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/}}
14+
15+
{{/*
16+
abstract: |
17+
Resolves database, or basic auth, style endpoints
18+
values: |
19+
endpoints:
20+
cluster_domain_suffix: cluster.local
21+
oslo_db:
22+
auth:
23+
admin:
24+
username: root
25+
password: password
26+
service_username:
27+
username: username
28+
password: password
29+
hosts:
30+
default: mariadb
31+
host_fqdn_override:
32+
default: null
33+
path: /dbname
34+
scheme: mysql+pymysql
35+
port:
36+
mysql:
37+
default: 3306
38+
usage: |
39+
{{ tuple "oslo_db" "internal" "service_username" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" }}
40+
return: |
41+
mysql+pymysql://serviceuser:password@mariadb.default.svc.cluster.local:3306/dbname
42+
*/}}
43+
44+
{{- define "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
45+
{{- $type := index . 0 -}}
46+
{{- $endpoint := index . 1 -}}
47+
{{- $userclass := index . 2 -}}
48+
{{- $port := index . 3 -}}
49+
{{- $context := index . 4 -}}
50+
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
51+
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
52+
{{- $endpointUser := index $userMap "username" }}
53+
{{- $endpointPass := index $userMap "password" | urlquery }}
54+
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
55+
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
56+
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
57+
{{- printf "%s://%s:%s@%s:%s%s" $endpointScheme $endpointUser $endpointPass $endpointHost $endpointPort $endpointPath -}}
58+
{{- end -}}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{{/*
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/}}
14+
15+
{{/*
16+
abstract: |
17+
Resolves endpoint string suitible for use with oslo.messaging transport url
18+
See: https://docs.openstack.org/oslo.messaging/latest/reference/transport.html#oslo_messaging.TransportURL
19+
examples:
20+
- values: |
21+
endpoints:
22+
cluster_domain_suffix: cluster.local
23+
oslo_messaging:
24+
auth:
25+
cinder:
26+
username: cinder
27+
password: password
28+
statefulset:
29+
replicas: 2
30+
name: rabbitmq-rabbitmq
31+
hosts:
32+
default: rabbitmq
33+
host_fqdn_override:
34+
default: null
35+
path: /cinder
36+
scheme: rabbit
37+
port:
38+
amqp:
39+
default: 5672
40+
usage: |
41+
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
42+
return: |
43+
rabbit://cinder:password@rabbitmq-rabbitmq-0.rabbitmq.default.svc.cluster.local:5672,cinder:password@rabbitmq-rabbitmq-1.rabbitmq.default.svc.cluster.local:5672/cinder
44+
- values: |
45+
endpoints:
46+
cluster_domain_suffix: cluster.local
47+
oslo_messaging:
48+
auth:
49+
cinder:
50+
username: cinder
51+
password: password
52+
statefulset: null
53+
hosts:
54+
default: rabbitmq
55+
host_fqdn_override:
56+
default: null
57+
path: /cinder
58+
scheme: rabbit
59+
port:
60+
amqp:
61+
default: 5672
62+
usage: |
63+
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
64+
return: |
65+
rabbit://cinder:password@rabbitmq.default.svc.cluster.local:5672/cinder
66+
- values: |
67+
endpoints:
68+
cluster_domain_suffix: cluster.local
69+
oslo_messaging:
70+
auth:
71+
cinder:
72+
username: cinder
73+
password: password
74+
statefulset:
75+
replicas: 2
76+
name: rabbitmq-rabbitmq
77+
hosts:
78+
default: rabbitmq
79+
host_fqdn_override:
80+
default: rabbitmq.openstackhelm.org
81+
path: /cinder
82+
scheme: rabbit
83+
port:
84+
amqp:
85+
default: 5672
86+
usage: |
87+
{{ tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" }}
88+
return: |
89+
rabbit://cinder:password@rabbitmq.openstackhelm.org:5672/cinder
90+
*/}}
91+
92+
{{- define "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" -}}
93+
{{- $type := index . 0 -}}
94+
{{- $endpoint := index . 1 -}}
95+
{{- $userclass := index . 2 -}}
96+
{{- $port := index . 3 -}}
97+
{{- $context := index . 4 -}}
98+
{{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }}
99+
{{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }}
100+
{{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}}
101+
{{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }}
102+
{{- $endpointUser := index $userMap "username" }}
103+
{{- $endpointPass := index $userMap "password" | urlquery }}
104+
{{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
105+
{{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
106+
{{- $local := dict "endpointCredsAndHosts" list -}}
107+
{{- if not (or (index $hostFqdnOverride $endpoint | default ( index $hostFqdnOverride "default" ) ) ( not $ssMap ) ) }}
108+
{{- $endpointHostPrefix := $ssMap.name }}
109+
{{- range $podInt := until ( atoi (print $ssMap.replicas ) ) }}
110+
{{- $endpointCredAndHost := printf "%s:%s@%s-%d.%s:%s" $endpointUser $endpointPass $endpointHostPrefix $podInt $endpointHostSuffix $endpointPort }}
111+
{{- $_ := set $local "endpointCredsAndHosts" ( append $local.endpointCredsAndHosts $endpointCredAndHost ) }}
112+
{{- end }}
113+
{{- else }}
114+
{{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
115+
{{- $endpointCredAndHost := printf "%s:%s@%s:%s" $endpointUser $endpointPass $endpointHost $endpointPort }}
116+
{{- $_ := set $local "endpointCredsAndHosts" ( append $local.endpointCredsAndHosts $endpointCredAndHost ) }}
117+
{{- end }}
118+
{{- $endpointCredsAndHosts := include "helm-toolkit.utils.joinListWithComma" $local.endpointCredsAndHosts }}
119+
{{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
120+
{{- printf "%s://%s%s" $endpointScheme $endpointCredsAndHosts $endpointPath }}
121+
{{- end -}}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{{/*
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/}}
14+
15+
{{/*
16+
abstract: |
17+
Resolves either the fully qualified hostname, of if defined in the host field
18+
IPv4 for an endpoint.
19+
examples:
20+
- values: |
21+
endpoints:
22+
cluster_domain_suffix: cluster.local
23+
oslo_db:
24+
hosts:
25+
default: mariadb
26+
host_fqdn_override:
27+
default: null
28+
usage: |
29+
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
30+
return: |
31+
mariadb.default.svc.cluster.local
32+
- values: |
33+
endpoints:
34+
cluster_domain_suffix: cluster.local
35+
oslo_db:
36+
hosts:
37+
default:
38+
host: mariadb
39+
host_fqdn_override:
40+
default: null
41+
usage: |
42+
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
43+
return: |
44+
mariadb.default.svc.cluster.local
45+
- values: |
46+
endpoints:
47+
cluster_domain_suffix: cluster.local
48+
oslo_db:
49+
hosts:
50+
default: 127.0.0.1
51+
host_fqdn_override:
52+
default: null
53+
usage: |
54+
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
55+
return: |
56+
127.0.0.1
57+
- values: |
58+
endpoints:
59+
cluster_domain_suffix: cluster.local
60+
oslo_db:
61+
hosts:
62+
default:
63+
host: 127.0.0.1
64+
host_fqdn_override:
65+
default: null
66+
usage: |
67+
{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.endpoint_host_lookup" }}
68+
return: |
69+
127.0.0.1
70+
*/}}
71+
72+
{{- define "helm-toolkit.endpoints.endpoint_host_lookup" -}}
73+
{{- $type := index . 0 -}}
74+
{{- $endpoint := index . 1 -}}
75+
{{- $context := index . 2 -}}
76+
{{- $endpointMap := index $context.Values.endpoints ( $type | replace "-" "_" ) }}
77+
{{- $endpointScheme := $endpointMap.scheme }}
78+
{{- $_ := set $context.Values "__endpointHost" ( index $endpointMap.hosts $endpoint | default $endpointMap.hosts.default ) }}
79+
{{- if kindIs "map" $context.Values.__endpointHost }}
80+
{{- $_ := set $context.Values "__endpointHost" ( index $context.Values.__endpointHost "host" ) }}
81+
{{- end }}
82+
{{- $endpointHost := $context.Values.__endpointHost }}
83+
{{- if regexMatch "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" $endpointHost }}
84+
{{- $endpointHostname := printf "%s" $endpointHost }}
85+
{{- printf "%s" $endpointHostname -}}
86+
{{- else }}
87+
{{- $endpointHostname := tuple $type $endpoint $context | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
88+
{{- printf "%s" $endpointHostname -}}
89+
{{- end }}
90+
{{- end -}}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{/*
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/}}
14+
15+
{{/*
16+
abstract: |
17+
Resolves the port for an endpoint
18+
values: |
19+
endpoints:
20+
cluster_domain_suffix: cluster.local
21+
oslo_db:
22+
port:
23+
mysql:
24+
default: 3306
25+
usage: |
26+
{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
27+
return: |
28+
3306
29+
*/}}
30+
31+
{{- define "helm-toolkit.endpoints.endpoint_port_lookup" -}}
32+
{{- $type := index . 0 -}}
33+
{{- $endpoint := index . 1 -}}
34+
{{- $port := index . 2 -}}
35+
{{- $context := index . 3 -}}
36+
{{- $typeYamlSafe := $type | replace "-" "_" }}
37+
{{- $endpointMap := index $context.Values.endpoints $typeYamlSafe }}
38+
{{- $endpointPortMAP := index $endpointMap.port $port }}
39+
{{- $endpointPort := index $endpointPortMAP $endpoint | default ( index $endpointPortMAP "default" ) }}
40+
{{- printf "%1.f" $endpointPort -}}
41+
{{- end -}}

0 commit comments

Comments
 (0)