Skip to content

Commit

Permalink
Add support for cluster template tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjpryor committed Sep 6, 2023
1 parent a9696da commit 292c153
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion roles/azimuth/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The chart to use
azimuth_chart_repo: https://stackhpc.github.io/azimuth
azimuth_chart_name: azimuth
azimuth_chart_version: 0.1.0-dev.0.feature-sdk-compat.765
azimuth_chart_version: 0.1.0-dev.0.feature-sdk-compat.766

# Release information for the Azimuth release
azimuth_release_namespace: azimuth
Expand Down
37 changes: 23 additions & 14 deletions roles/azimuth_capi_operator/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The chart to use
azimuth_capi_operator_chart_repo: https://stackhpc.github.io/azimuth-capi-operator
azimuth_capi_operator_chart_name: azimuth-capi-operator
azimuth_capi_operator_chart_version: 0.1.0-dev.0.main.130
azimuth_capi_operator_chart_version: 0.1.0-dev.0.feature-template-tags.136

# Release information for the CAPI operator release
# Use the same namespace as Azimuth by default
Expand Down Expand Up @@ -415,28 +415,37 @@ azimuth_capi_operator_release_values: >-
# All other templates will be marked as DEPRECATED
# azimuth-ops currently never removes templates
#####
# Tags for the default Kubernetes apps
azimuth_capi_operator_cluster_template_tags: [standard]
# Settings for the default Kubernetes templates
azimuth_capi_operator_cluster_template_defaults:
tags: "{{ azimuth_capi_operator_cluster_template_tags }}"
values:
clusterNetworking:
internalNetwork:
networkFilter:
tags: portal-internal
# By default, make a template for each Kubernetes release for which we have an image
azimuth_capi_operator_cluster_templates_default: |-
{
{% for key, image in community_images.items() %}
{% if "kubernetes_version" in image %}
{% set kube_vn_no_prefix = image.kubernetes_version.removeprefix("v") %}
{% set kube_vn_dash = kube_vn_no_prefix | replace('.', '-') %}
"kube-{{ kube_vn_dash }}": {
"label": "{{ image.kubernetes_version }}",
"description": "Kubernetes {{ kube_vn_no_prefix }} with HA control plane.",
"values": {
"kubernetesVersion": "{{ kube_vn_no_prefix }}",
"machineImageId": "{{ community_images_image_ids[key] }}",
"clusterNetworking": {
"internalNetwork": {
"networkFilter": {
"tags": "portal-internal",
"kube-{{ kube_vn_dash }}": {{
azimuth_capi_operator_cluster_template_defaults |
combine(
{
"label": image.kubernetes_version,
"description": "Kubernetes " ~ kube_vn_no_prefix ~ " with HA control plane.",
"values": {
"kubernetesVersion": kube_vn_no_prefix,
"machineImageId": community_images_image_ids[key],
},
},
},
},
},
recursive = True
)
}},
{% endif %}
{% endfor %}
}
Expand Down

0 comments on commit 292c153

Please sign in to comment.