1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 apiVersion: argoproj.io/v1alpha1
19 kind: WorkflowTemplate
21 name: ksu-management-wft
22 namespace: osm-workflows
26 # Create a KSU based on an OKA Package which includes a `HelmRelease`
27 - name: create-ksu-oka-hr
30 # References to required external resources
31 - name: fleet_volume_name
32 - name: fleet_mount_path
34 - name: sw_catalogs_volume_name
35 - name: sw_catalogs_mount_path
37 # Specific parameters - Base KSU generation from template
38 - name: templates_path
39 ## Should substitute environment variables in the template?
40 - name: substitute_environment
42 ## Filter for substitution of environment variables
43 - name: substitution_filter
45 ## Custom environment variables (formatted as .env), to be used for template parametrization
46 - name: custom_env_vars
48 ## Root folder of the cloned SW Catalogs repo - Do not touch
49 - name: cloned_sw_catalogs_folder_name
50 value: "sw-catalogs-osm"
51 # Specific parameters - Patch HelmRelease in KSU with inline values
52 - name: kustomization_name
53 - name: helmrelease_name
56 # Specific parameters - Secret generation
57 - name: is_preexisting_secret
60 - name: age_public_key
61 - name: values_secret_name
62 - name: reference_secret_for_values
63 - name: reference_key_for_values
66 # Specific parameters - Configmap generation
67 - name: is_preexisting_cm
69 - name: values_cm_name
74 # Specific parameters - KSU rendering
82 ## Root folder of the cloned Fleet repo - Do not touch
83 - name: cloned_fleet_folder_name
89 image: ttl.sh/osm-krm-functions:24h
90 # imagePullPolicy: Always
95 name: "{{inputs.parameters.reference_secret_for_values}}"
96 key: "{{inputs.parameters.reference_key_for_values}}"
99 value: "{{inputs.parameters.debug}}"
100 command: ["/app/scripts/entrypoint.sh"]
102 - create_hr_ksu_into_profile
103 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
104 - "{{inputs.parameters.substitute_environment}}"
105 - "{{inputs.parameters.substitution_filter}}"
106 - "{{inputs.parameters.custom_env_vars}}"
107 - "{{inputs.parameters.kustomization_name}}"
108 - "{{inputs.parameters.helmrelease_name}}"
109 - "{{inputs.parameters.inline_values}}"
110 - "{{inputs.parameters.is_preexisting_secret}}"
111 - "{{inputs.parameters.target_ns}}"
112 - "{{inputs.parameters.values_secret_name}}"
113 - "{{inputs.parameters.secret_key}}"
114 - "{{inputs.parameters.age_public_key}}"
116 - "{{inputs.parameters.is_preexisting_cm}}"
117 - "{{inputs.parameters.values_cm_name}}"
118 - "{{inputs.parameters.cm_key}}"
119 - "{{inputs.parameters.cm_values}}"
120 - "{{inputs.parameters.ksu_name}}"
121 - "{{inputs.parameters.profile_name}}"
122 - "{{inputs.parameters.profile_type}}"
123 - "{{inputs.parameters.project_name}}"
124 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
125 - "{{inputs.parameters.sync}}"
128 mountPath: '{{inputs.parameters.fleet_mount_path}}'
129 - name: sw-catalogs-repo-volume
130 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
133 persistentVolumeClaim:
134 claimName: '{{inputs.parameters.fleet_volume_name}}'
135 - name: sw-catalogs-repo-volume
136 persistentVolumeClaim:
137 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
144 # Update a KSU based on an OKA Package which includes a `HelmRelease`
145 - name: update-ksu-oka-hr
148 # References to required external resources
149 - name: fleet_volume_name
150 - name: fleet_mount_path
152 - name: sw_catalogs_volume_name
153 - name: sw_catalogs_mount_path
154 value: "/sw-catalogs"
155 # Specific parameters - Base KSU generation from template
156 - name: templates_path
157 ## Should substitute environment variables in the template?
158 - name: substitute_environment
160 ## Filter for substitution of environment variables
161 - name: substitution_filter
163 ## Custom environment variables (formatted as .env), to be used for template parametrization
164 - name: custom_env_vars
166 ## Root folder of the cloned SW Catalogs repo - Do not touch
167 - name: cloned_sw_catalogs_folder_name
168 value: "sw-catalogs-osm"
169 # Specific parameters - Patch HelmRelease in KSU with inline values
170 - name: kustomization_name
171 - name: helmrelease_name
172 - name: inline_values
174 # Specific parameters - Secret generation
175 - name: is_preexisting_secret
178 - name: age_public_key
179 - name: values_secret_name
180 - name: reference_secret_for_values
181 - name: reference_key_for_values
184 # Specific parameters - Configmap generation
185 - name: is_preexisting_cm
187 - name: values_cm_name
192 # Specific parameters - KSU rendering
198 ## Root folder of the cloned Fleet repo - Do not touch
199 - name: cloned_fleet_folder_name
205 image: ttl.sh/osm-krm-functions:24h
206 # imagePullPolicy: Always
208 - name: SECRET_VALUES
211 name: "{{inputs.parameters.reference_secret_for_values}}"
212 key: "{{inputs.parameters.reference_key_for_values}}"
215 value: "{{inputs.parameters.debug}}"
216 command: ["/app/scripts/entrypoint.sh"]
218 - update_hr_ksu_into_profile
219 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
220 - "{{inputs.parameters.substitute_environment}}"
221 - "{{inputs.parameters.substitution_filter}}"
222 - "{{inputs.parameters.custom_env_vars}}"
223 - "{{inputs.parameters.kustomization_name}}"
224 - "{{inputs.parameters.helmrelease_name}}"
225 - "{{inputs.parameters.inline_values}}"
226 - "{{inputs.parameters.is_preexisting_secret}}"
227 - "{{inputs.parameters.target_ns}}"
228 - "{{inputs.parameters.values_secret_name}}"
229 - "{{inputs.parameters.secret_key}}"
230 - "{{inputs.parameters.age_public_key}}"
232 - "{{inputs.parameters.is_preexisting_cm}}"
233 - "{{inputs.parameters.values_cm_name}}"
234 - "{{inputs.parameters.cm_key}}"
235 - "{{inputs.parameters.cm_values}}"
236 - "{{inputs.parameters.ksu_name}}"
237 - "{{inputs.parameters.profile_name}}"
238 - "{{inputs.parameters.profile_type}}"
239 - "{{inputs.parameters.project_name}}"
240 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
243 mountPath: '{{inputs.parameters.fleet_mount_path}}'
244 - name: sw-catalogs-repo-volume
245 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
248 persistentVolumeClaim:
249 claimName: '{{inputs.parameters.fleet_volume_name}}'
250 - name: sw-catalogs-repo-volume
251 persistentVolumeClaim:
252 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
259 # Create a "generated" KSU from `HelmRelease` and Source Repo definitions
260 - name: create-ksu-generated-hr
263 # References to required external resources
264 - name: fleet_volume_name
265 - name: fleet_mount_path
267 # HelmRelease generation
268 - name: helmrelease_name
270 - name: chart_version
273 # Repo source generation
274 - name: is_preexisting_repo
276 - name: helmrepo_name
280 expression: "{{input.parameters.target_ns}}"
281 - name: helmrepo_secret_ref
282 # HelmRelease inline values (if any)
283 - name: inline_values
285 # Secret reference and generation (if required)
286 - name: is_preexisting_secret
288 - name: values_secret_name
291 - name: age_public_key
292 ## Secret values will be obtained from the
293 ## secret named after the input parameter `reference_secret_for_values`,
294 ## and from the key named after the input parameter `reference_key_for_values`
295 - name: reference_secret_for_values
296 - name: reference_key_for_values
297 # ConfigMap reference and generation (if required)
298 - name: is_preexisting_cm
300 - name: values_cm_name
311 # By default, it will not syncronize, so that we can easily accumulate more than
312 # one Helm chart into the same KSU if desired
315 ## Root folder of the cloned Fleet repo - Do not touch
316 ### `FLEET_REPO_DIR` is the result of:
317 ### "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
318 - name: cloned_fleet_folder_name
325 image: ttl.sh/osm-krm-functions:24h
326 # imagePullPolicy: Always
328 - name: SECRET_VALUES
331 name: "{{inputs.parameters.reference_secret_for_values}}"
332 key: "{{inputs.parameters.reference_key_for_values}}"
335 value: "{{inputs.parameters.debug}}"
336 command: ["/app/scripts/entrypoint.sh"]
338 - create_generated_ksu_from_helm_into_profile
339 - "{{inputs.parameters.helmrelease_name}}"
340 - "{{inputs.parameters.chart_name}}"
341 - "{{inputs.parameters.chart_version}}"
342 - "{{inputs.parameters.target_ns}}"
343 - "{{inputs.parameters.create_ns}}"
344 - "{{inputs.parameters.is_preexisting_repo}}"
345 - "{{inputs.parameters.helmrepo_name}}"
346 - "{{inputs.parameters.helmrepo_url}}"
347 - "{{inputs.parameters.helmrepo_ns}}"
348 - "{{inputs.parameters.helmrepo_secret_ref}}"
349 - "{{inputs.parameters.inline_values}}"
350 - "{{inputs.parameters.is_preexisting_secret}}"
351 - "{{inputs.parameters.values_secret_name}}"
352 - "{{inputs.parameters.secret_key}}"
353 - "{{inputs.parameters.age_public_key}}"
355 - "{{inputs.parameters.is_preexisting_cm}}"
356 - "{{inputs.parameters.values_cm_name}}"
357 - "{{inputs.parameters.cm_key}}"
358 - "{{inputs.parameters.cm_values}}"
359 - "{{inputs.parameters.ksu_name}}"
360 - "{{inputs.parameters.profile_name}}"
361 - "{{inputs.parameters.profile_type}}"
362 - "{{inputs.parameters.project_name}}"
363 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
364 - "{{inputs.parameters.sync}}"
367 mountPath: '{{inputs.parameters.fleet_mount_path}}'
370 persistentVolumeClaim:
371 claimName: '{{inputs.parameters.fleet_volume_name}}'
378 # Update a "generated" KSU from `HelmRelease` and Source Repo definitions
379 - name: update-ksu-generated-hr
382 # References to required external resources
383 - name: fleet_volume_name
384 - name: fleet_mount_path
386 # HelmRelease generation
387 - name: helmrelease_name
389 - name: chart_version
392 # Repo source generation
393 - name: is_preexisting_repo
395 - name: helmrepo_name
399 expression: "{{input.parameters.target_ns}}"
400 - name: helmrepo_secret_ref
401 # HelmRelease inline values (if any)
402 - name: inline_values
404 # Secret reference and generation (if required)
405 - name: is_preexisting_secret
407 - name: values_secret_name
410 - name: age_public_key
411 ## Secret values will be obtained from the
412 ## secret named after the input parameter `reference_secret_for_values`,
413 ## and from the key named after the input parameter `reference_key_for_values`
414 - name: reference_secret_for_values
415 - name: reference_key_for_values
416 # ConfigMap reference and generation (if required)
417 - name: is_preexisting_cm
419 - name: values_cm_name
430 ## Root folder of the cloned Fleet repo - Do not touch
431 ### `FLEET_REPO_DIR` is the result of:
432 ### "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
433 - name: cloned_fleet_folder_name
440 image: ttl.sh/osm-krm-functions:24h
441 # imagePullPolicy: Always
443 - name: SECRET_VALUES
446 name: "{{inputs.parameters.reference_secret_for_values}}"
447 key: "{{inputs.parameters.reference_key_for_values}}"
450 value: "{{inputs.parameters.debug}}"
451 command: ["/app/scripts/entrypoint.sh"]
453 - update_generated_ksu_from_helm_into_profile
454 - "{{inputs.parameters.helmrelease_name}}"
455 - "{{inputs.parameters.chart_name}}"
456 - "{{inputs.parameters.chart_version}}"
457 - "{{inputs.parameters.target_ns}}"
458 - "{{inputs.parameters.create_ns}}"
459 - "{{inputs.parameters.is_preexisting_repo}}"
460 - "{{inputs.parameters.helmrepo_name}}"
461 - "{{inputs.parameters.helmrepo_url}}"
462 - "{{inputs.parameters.helmrepo_ns}}"
463 - "{{inputs.parameters.helmrepo_secret_ref}}"
464 - "{{inputs.parameters.inline_values}}"
465 - "{{inputs.parameters.is_preexisting_secret}}"
466 - "{{inputs.parameters.values_secret_name}}"
467 - "{{inputs.parameters.secret_key}}"
468 - "{{inputs.parameters.age_public_key}}"
470 - "{{inputs.parameters.is_preexisting_cm}}"
471 - "{{inputs.parameters.values_cm_name}}"
472 - "{{inputs.parameters.cm_key}}"
473 - "{{inputs.parameters.cm_values}}"
474 - "{{inputs.parameters.ksu_name}}"
475 - "{{inputs.parameters.profile_name}}"
476 - "{{inputs.parameters.profile_type}}"
477 - "{{inputs.parameters.project_name}}"
478 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
481 mountPath: '{{inputs.parameters.fleet_mount_path}}'
484 persistentVolumeClaim:
485 claimName: '{{inputs.parameters.fleet_volume_name}}'
492 # Delete a KSU from a profile
496 # References to required external resources
497 - name: fleet_volume_name
498 - name: fleet_mount_path
500 - name: sw_catalogs_volume_name
501 - name: sw_catalogs_mount_path
502 value: "/sw-catalogs"
503 # Specific parameters - KSU id
509 # Other parameters - Do not touch
510 - name: cloned_fleet_folder_name
512 - name: cloned_sw_catalogs_folder_name
513 value: "sw-catalogs-osm"
518 image: ttl.sh/osm-krm-functions:24h
519 # imagePullPolicy: Always
522 value: "{{inputs.parameters.debug}}"
523 command: ["/app/scripts/entrypoint.sh"]
525 - delete_ksu_from_profile
526 - "{{inputs.parameters.ksu_name}}"
527 - "{{inputs.parameters.profile_name}}"
528 - "{{inputs.parameters.profile_type}}"
529 - "{{inputs.parameters.project_name}}"
530 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
533 mountPath: '{{inputs.parameters.fleet_mount_path}}'
534 - name: sw-catalogs-repo-volume
535 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
538 persistentVolumeClaim:
539 claimName: '{{inputs.parameters.fleet_volume_name}}'
540 - name: sw-catalogs-repo-volume
541 persistentVolumeClaim:
542 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
549 # Clone a KSU from a profile to another
553 # References to required external resources
554 - name: fleet_volume_name
555 - name: fleet_mount_path
557 # Specific parameters - Source and destination KSU
559 - name: source_ksu_name
560 - name: source_profile_name
561 - name: source_profile_type
562 - name: source_project_name
565 ## - If any of the destination parameters are not specified, it will assume
566 ## they are the same as in source.
567 ## - It will reject if all are empty or equal to source, to avoid cloning a KSU over itself
568 - name: destination_ksu_name
570 - name: destination_profile_name
572 - name: destination_profile_type
574 - name: destination_project_name
576 # Other parameters - Do not touch
577 - name: cloned_fleet_folder_name
583 image: ttl.sh/osm-krm-functions:24h
584 # imagePullPolicy: Always
587 value: "{{inputs.parameters.debug}}"
588 command: ["/app/scripts/entrypoint.sh"]
591 - "{{inputs.parameters.source_ksu_name}}"
592 - "{{inputs.parameters.source_profile_name}}"
593 - "{{inputs.parameters.source_profile_type}}"
594 - "{{inputs.parameters.source_project_name}}"
595 - "{{inputs.parameters.destination_ksu_name}}"
596 - "{{inputs.parameters.destination_profile_name}}"
597 - "{{inputs.parameters.destination_profile_type}}"
598 - "{{inputs.parameters.destination_project_name}}"
599 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
602 mountPath: '{{inputs.parameters.fleet_mount_path}}'
605 persistentVolumeClaim:
606 claimName: '{{inputs.parameters.fleet_volume_name}}'
613 # Read template folder from OKA Package and convert to `ResourceList`
614 # It can work as KRM generator function, since it accepts an optional input `ResourceList`
618 # References to required external resources
619 - name: sw_catalogs_volume_name
620 - name: temp_volume_name
621 # Filename for input stream
622 - name: input_stream_file
624 # Specific parameters
625 ## Relative path from `sw_catalogs_mount_path`
626 - name: templates_path
627 ## Should substitute environment variables in the template?
628 - name: substitute_environment
630 ## Filter for substitution of environment variables
631 - name: substitution_filter
633 ## Custom environment variables (formatted as .env), to be used for template parametrization
634 - name: custom_env_vars
642 # Other parameters - Do not touch
643 - name: sw_catalogs_mount_path
644 value: "/sw-catalogs"
645 - name: cloned_sw_catalogs_folder_name
646 value: "sw-catalogs-osm"
648 value: "{{=sprig.randAlphaNum(9)}}"
652 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
654 image: ttl.sh/osm-krm-functions:24h
655 # imagePullPolicy: Always
658 value: "{{inputs.parameters.input_stream_file}}"
660 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
662 value: "{{inputs.parameters.custom_env_vars}}"
664 value: "{{inputs.parameters.debug}}"
665 command: ["/app/scripts/entrypoint.sh"]
667 - folder2list_generator
668 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
669 - "{{inputs.parameters.substitute_environment}}"
670 - "{{inputs.parameters.substitution_filter}}"
673 mountPath: "/results"
674 - name: sw-catalogs-repo-volume
675 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
678 persistentVolumeClaim:
679 claimName: '{{inputs.parameters.temp_volume_name}}'
680 - name: sw-catalogs-repo-volume
681 persistentVolumeClaim:
682 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
689 # Transform `ResourceList`'s main Kustomization to patch `HelmRelease` to use
691 - name: transform-ks-add-values-to-hr
694 # References to required external resources
695 - name: temp_volume_name
696 # Specific parameters - Generator
697 ## Filename for input stream
698 - name: input_stream_file
699 # Specific parameters
701 - name: kustomization_name
702 - name: helmrelease_name
703 ## Input values for the Helm Chart
704 - name: inline_values
708 # Other parameters - Do not touch
710 value: "{{=sprig.randAlphaNum(9)}}"
714 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
716 image: ttl.sh/osm-krm-functions:24h
717 # imagePullPolicy: Always
720 value: "{{inputs.parameters.input_stream_file}}"
722 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
724 value: "{{inputs.parameters.debug}}"
725 command: ["/app/scripts/entrypoint.sh"]
727 - add_values_to_helmrelease_via_ks
728 - "{{inputs.parameters.kustomization_name}}"
729 - "{{inputs.parameters.helmrelease_name}}"
730 - "{{inputs.parameters.inline_values}}"
733 mountPath: "/results"
736 persistentVolumeClaim:
737 claimName: '{{inputs.parameters.temp_volume_name}}'
744 # Transform `ResourceList`'s main Kustomization to patch `HelmRelease` to use
745 # values from a Secret, a ConfigMap or both.
746 - name: transform-ks-add-referenced-values-to-hr
749 # References to required external resources
750 - name: temp_volume_name
751 # Specific parameters - Generator
752 ## Filename for input stream
753 - name: input_stream_file
754 # Specific parameters
755 - name: kustomization_name
756 - name: helmrelease_name
757 ## Source for values (Secret, ConfigMap or both)
758 - name: values_secret_name
760 - name: values_cm_name
765 # Other parameters - Do not touch
767 value: "{{=sprig.randAlphaNum(9)}}"
771 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
773 image: ttl.sh/osm-krm-functions:24h
774 # imagePullPolicy: Always
777 value: "{{inputs.parameters.input_stream_file}}"
779 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
781 value: "{{inputs.parameters.debug}}"
782 command: ["/app/scripts/entrypoint.sh"]
784 - add_ref_values_to_hr_via_ks
785 - "{{inputs.parameters.kustomization_name}}"
786 - "{{inputs.parameters.helmrelease_name}}"
787 - "{{inputs.parameters.values_secret_name}}"
788 - "{{inputs.parameters.values_cm_name}}"
791 mountPath: "/results"
794 persistentVolumeClaim:
795 claimName: '{{inputs.parameters.temp_volume_name}}'
802 # KRM function to render a ResourceList with a KSU into a target profile
803 - name: render-ksu-into-profile
806 # References to required external resources
807 - name: fleet_volume_name
808 - name: temp_volume_name
809 # Filename for input stream
810 - name: input_stream_file
811 # Specific parameters
817 ## Whether the target KSU folder will be fully re-created on render
823 # Other parameters - Do not touch
824 - name: fleet_mount_path
826 - name: fleet_repo_dir
827 value: "/fleet/fleet-osm/"
829 value: "{{=sprig.randAlphaNum(9)}}"
833 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
835 image: ttl.sh/osm-krm-functions:24h
836 # imagePullPolicy: Always
839 value: "{{inputs.parameters.input_stream_file}}"
841 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
843 value: "{{inputs.parameters.debug}}"
844 command: ["/app/scripts/entrypoint.sh"]
846 - render_ksu_into_profile
847 - "{{inputs.parameters.ksu_name}}"
848 - "{{inputs.parameters.profile_name}}"
849 - "{{inputs.parameters.profile_type}}"
850 - "{{inputs.parameters.project_name}}"
851 - "{{inputs.parameters.fleet_repo_dir}}"
852 - "{{inputs.parameters.sync}}"
855 mountPath: "/results"
857 mountPath: '{{inputs.parameters.fleet_mount_path}}'
860 persistentVolumeClaim:
861 claimName: '{{inputs.parameters.temp_volume_name}}'
863 persistentVolumeClaim:
864 claimName: '{{inputs.parameters.fleet_volume_name}}'
871 # KRM generator to create Secrets suitable to pass values to `HelmReleases`
872 - name: generator-secret-hr-values
875 # References to required external resources
876 - name: temp_volume_name
877 # Specific parameters - Generator
878 ## Filename for input stream
879 - name: input_stream_file
881 ## Name of final manifest filename into generated `ResourceList` object
882 - name: final_manifest_filename
883 # Specific parameters - Secret
884 - name: age_public_key
885 - name: values_secret_name
887 - name: reference_secret_for_values
888 - name: reference_key_for_values
898 parameter: '{{steps.generate-resourcelist.outputs.parameters.output_file}}'
900 - - name: build-manifest
902 name: ksu-management-wft
903 template: manifest-secret-hr-values
906 # References to required external resources
907 - name: temp_volume_name
908 value: "{{inputs.parameters.temp_volume_name}}"
909 # Specific parameters
910 - name: age_public_key
911 value: "{{inputs.parameters.age_public_key}}"
912 - name: values_secret_name
913 value: "{{inputs.parameters.values_secret_name}}"
915 value: "{{inputs.parameters.target_ns}}"
916 - name: reference_secret_for_values
917 value: "{{inputs.parameters.reference_secret_for_values}}"
918 - name: reference_key_for_values
919 value: "{{inputs.parameters.reference_key_for_values}}"
921 value: "{{inputs.parameters.secret_key}}"
924 value: "{{inputs.parameters.debug}}"
925 - - name: generate-resourcelist
927 name: ksu-management-wft
928 template: make-generator
931 # References to required external resources
932 - name: temp_volume_name
933 value: "{{inputs.parameters.temp_volume_name}}"
934 # Filename for input stream
935 - name: input_stream_file
936 value: "{{inputs.parameters.input_stream_file}}"
937 # File with raw manifest
938 - name: input_manifest_file
939 value: '{{steps.build-manifest.outputs.parameters.output_file}}'
940 # Name of final manifest filename into generated `ResourceList` object
941 - name: final_manifest_filename
942 value: "{{inputs.parameters.final_manifest_filename}}"
945 value: "{{inputs.parameters.debug}}"
948 # KRM generator to create ConfigMaps suitable to pass values to `HelmReleases`
949 - name: generator-cm-hr-values
952 # References to required external resources
953 - name: temp_volume_name
954 # Specific parameters - Generator
955 ## Filename for input stream
956 - name: input_stream_file
958 ## Name of final manifest filename into generated `ResourceList` object
959 - name: final_manifest_filename
960 # Specific parameters - ConfigMap
961 - name: values_cm_name
973 parameter: '{{steps.generate-resourcelist.outputs.parameters.output_file}}'
975 - - name: build-manifest
977 name: ksu-management-wft
978 template: manifest-cm-hr-values
981 # References to required external resources
982 - name: temp_volume_name
983 value: "{{inputs.parameters.temp_volume_name}}"
984 # Specific parameters
985 - name: values_cm_name
986 value: "{{inputs.parameters.values_cm_name}}"
988 value: "{{inputs.parameters.target_ns}}"
990 value: "{{inputs.parameters.cm_key}}"
992 value: "{{inputs.parameters.cm_values}}"
995 value: "{{inputs.parameters.debug}}"
996 - - name: generate-resourcelist
998 name: ksu-management-wft
999 template: make-generator
1002 # References to required external resources
1003 - name: temp_volume_name
1004 value: "{{inputs.parameters.temp_volume_name}}"
1005 # Filename for input stream
1006 - name: input_stream_file
1007 value: "{{inputs.parameters.input_stream_file}}"
1008 # File with raw manifest
1009 - name: input_manifest_file
1010 value: '{{steps.build-manifest.outputs.parameters.output_file}}'
1011 # Name of final manifest filename into generated `ResourceList` object
1012 - name: final_manifest_filename
1013 value: "{{inputs.parameters.final_manifest_filename}}"
1016 value: "{{inputs.parameters.debug}}"
1019 # Converts a manifest to a KRM generator
1020 - name: make-generator
1023 # References to required external resources
1024 - name: temp_volume_name
1025 # Filename for input stream
1026 - name: input_stream_file
1028 # File with raw manifest
1029 - name: input_manifest_file
1030 # Name of final manifest filename into generated `ResourceList` object
1031 - name: final_manifest_filename
1035 # Other parameters - Do not touch
1037 value: "{{=sprig.randAlphaNum(9)}}"
1041 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
1043 image: ttl.sh/osm-krm-functions:24h
1044 # imagePullPolicy: Always
1047 value: "{{inputs.parameters.input_stream_file}}"
1049 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
1051 value: "{{inputs.parameters.debug}}"
1052 command: ["/app/scripts/entrypoint.sh"]
1055 - "{{inputs.parameters.final_manifest_filename}}"
1057 - "{{inputs.parameters.input_manifest_file}}"
1060 mountPath: "/results"
1063 persistentVolumeClaim:
1064 claimName: '{{inputs.parameters.temp_volume_name}}'
1071 # Produces a secret manifest and encrypts it with SOPS
1072 - name: manifest-secret-hr-values
1075 # References to required external resources
1076 - name: temp_volume_name
1077 # Public age key to encrypt secret
1078 - name: age_public_key
1079 # Name of the secret to be created
1080 - name: values_secret_name
1081 # Namespace for the secret
1083 # Input secret that contains the values to embed into the new secret
1084 - name: reference_secret_for_values
1085 - name: reference_key_for_values
1086 value: "values.yaml"
1087 # Key in the new secret where the values will be inserted
1089 value: "values.yaml"
1093 # Other parameters - Do not touch
1095 value: "{{=sprig.randAlphaNum(9)}}"
1099 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1101 image: ttl.sh/osm-krm-functions:24h
1102 # imagePullPolicy: Always
1107 name: "{{inputs.parameters.reference_secret_for_values}}"
1108 key: "{{inputs.parameters.reference_key_for_values}}"
1110 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1112 value: "{{inputs.parameters.debug}}"
1113 command: ["/app/scripts/entrypoint.sh"]
1116 - "{{inputs.parameters.age_public_key}}"
1120 - "{{inputs.parameters.values_secret_name}}"
1121 - --namespace={{inputs.parameters.target_ns}}
1122 - --from-file={{inputs.parameters.secret_key}}=/dev/stdin
1127 mountPath: "/results"
1130 persistentVolumeClaim:
1131 claimName: '{{inputs.parameters.temp_volume_name}}'
1138 # Produces a ConfigMap manifest
1139 - name: manifest-cm-hr-values
1142 # References to required external resources
1143 - name: temp_volume_name
1144 # Specific parameters
1145 - name: values_cm_name
1148 value: "values.yaml"
1153 # Other parameters - Do not touch
1155 value: "{{=sprig.randAlphaNum(9)}}"
1159 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1161 image: ttl.sh/osm-krm-functions:24h
1162 # imagePullPolicy: Always
1165 value: "{{inputs.parameters.cm_values}}"
1167 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1169 value: "{{inputs.parameters.debug}}"
1170 command: ["/app/scripts/entrypoint.sh"]
1175 - "{{inputs.parameters.values_cm_name}}"
1176 - --namespace={{inputs.parameters.target_ns}}
1177 - --from-file={{inputs.parameters.cm_key}}=/dev/stdin
1182 mountPath: "/results"
1185 persistentVolumeClaim:
1186 claimName: '{{inputs.parameters.temp_volume_name}}'