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}}"
100 value: "{{inputs.parameters.debug}}"
101 command: ["/app/scripts/entrypoint.sh"]
103 - create_hr_ksu_into_profile
104 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
105 - "{{inputs.parameters.substitute_environment}}"
106 - "{{inputs.parameters.substitution_filter}}"
107 - "{{inputs.parameters.custom_env_vars}}"
108 - "{{inputs.parameters.kustomization_name}}"
109 - "{{inputs.parameters.helmrelease_name}}"
110 - "{{inputs.parameters.inline_values}}"
111 - "{{inputs.parameters.is_preexisting_secret}}"
112 - "{{inputs.parameters.target_ns}}"
113 - "{{inputs.parameters.values_secret_name}}"
114 - "{{inputs.parameters.secret_key}}"
115 - "{{inputs.parameters.age_public_key}}"
117 - "{{inputs.parameters.is_preexisting_cm}}"
118 - "{{inputs.parameters.values_cm_name}}"
119 - "{{inputs.parameters.cm_key}}"
120 - "{{inputs.parameters.cm_values}}"
121 - "{{inputs.parameters.ksu_name}}"
122 - "{{inputs.parameters.profile_name}}"
123 - "{{inputs.parameters.profile_type}}"
124 - "{{inputs.parameters.project_name}}"
125 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
126 - "{{inputs.parameters.sync}}"
129 mountPath: '{{inputs.parameters.fleet_mount_path}}'
130 - name: sw-catalogs-repo-volume
131 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
134 persistentVolumeClaim:
135 claimName: '{{inputs.parameters.fleet_volume_name}}'
136 - name: sw-catalogs-repo-volume
137 persistentVolumeClaim:
138 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
145 # Update a KSU based on an OKA Package which includes a `HelmRelease`
146 - name: update-ksu-oka-hr
149 # References to required external resources
150 - name: fleet_volume_name
151 - name: fleet_mount_path
153 - name: sw_catalogs_volume_name
154 - name: sw_catalogs_mount_path
155 value: "/sw-catalogs"
156 # Specific parameters - Base KSU generation from template
157 - name: templates_path
158 ## Should substitute environment variables in the template?
159 - name: substitute_environment
161 ## Filter for substitution of environment variables
162 - name: substitution_filter
164 ## Custom environment variables (formatted as .env), to be used for template parametrization
165 - name: custom_env_vars
167 ## Root folder of the cloned SW Catalogs repo - Do not touch
168 - name: cloned_sw_catalogs_folder_name
169 value: "sw-catalogs-osm"
170 # Specific parameters - Patch HelmRelease in KSU with inline values
171 - name: kustomization_name
172 - name: helmrelease_name
173 - name: inline_values
175 # Specific parameters - Secret generation
176 - name: is_preexisting_secret
179 - name: age_public_key
180 - name: values_secret_name
181 - name: reference_secret_for_values
182 - name: reference_key_for_values
185 # Specific parameters - Configmap generation
186 - name: is_preexisting_cm
188 - name: values_cm_name
193 # Specific parameters - KSU rendering
199 ## Root folder of the cloned Fleet repo - Do not touch
200 - name: cloned_fleet_folder_name
206 image: ttl.sh/osm-krm-functions:24h
207 # imagePullPolicy: Always
209 - name: SECRET_VALUES
212 name: "{{inputs.parameters.reference_secret_for_values}}"
213 key: "{{inputs.parameters.reference_key_for_values}}"
217 value: "{{inputs.parameters.debug}}"
218 command: ["/app/scripts/entrypoint.sh"]
220 - update_hr_ksu_into_profile
221 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
222 - "{{inputs.parameters.substitute_environment}}"
223 - "{{inputs.parameters.substitution_filter}}"
224 - "{{inputs.parameters.custom_env_vars}}"
225 - "{{inputs.parameters.kustomization_name}}"
226 - "{{inputs.parameters.helmrelease_name}}"
227 - "{{inputs.parameters.inline_values}}"
228 - "{{inputs.parameters.is_preexisting_secret}}"
229 - "{{inputs.parameters.target_ns}}"
230 - "{{inputs.parameters.values_secret_name}}"
231 - "{{inputs.parameters.secret_key}}"
232 - "{{inputs.parameters.age_public_key}}"
234 - "{{inputs.parameters.is_preexisting_cm}}"
235 - "{{inputs.parameters.values_cm_name}}"
236 - "{{inputs.parameters.cm_key}}"
237 - "{{inputs.parameters.cm_values}}"
238 - "{{inputs.parameters.ksu_name}}"
239 - "{{inputs.parameters.profile_name}}"
240 - "{{inputs.parameters.profile_type}}"
241 - "{{inputs.parameters.project_name}}"
242 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
245 mountPath: '{{inputs.parameters.fleet_mount_path}}'
246 - name: sw-catalogs-repo-volume
247 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
250 persistentVolumeClaim:
251 claimName: '{{inputs.parameters.fleet_volume_name}}'
252 - name: sw-catalogs-repo-volume
253 persistentVolumeClaim:
254 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
261 # Create a "generated" KSU from `HelmRelease` and Source Repo definitions
262 - name: create-ksu-generated-hr
265 # References to required external resources
266 - name: fleet_volume_name
267 - name: fleet_mount_path
269 # HelmRelease generation
270 - name: helmrelease_name
272 - name: chart_version
275 # Repo source generation
276 - name: is_preexisting_repo
278 - name: helmrepo_name
282 expression: "{{input.parameters.target_ns}}"
283 - name: helmrepo_secret_ref
284 # HelmRelease inline values (if any)
285 - name: inline_values
287 # Secret reference and generation (if required)
288 - name: is_preexisting_secret
290 - name: values_secret_name
293 - name: age_public_key
294 ## Secret values will be obtained from the
295 ## secret named after the input parameter `reference_secret_for_values`,
296 ## and from the key named after the input parameter `reference_key_for_values`
297 - name: reference_secret_for_values
298 - name: reference_key_for_values
299 # ConfigMap reference and generation (if required)
300 - name: is_preexisting_cm
302 - name: values_cm_name
313 # By default, it will not syncronize, so that we can easily accumulate more than
314 # one Helm chart into the same KSU if desired
317 ## Root folder of the cloned Fleet repo - Do not touch
318 ### `FLEET_REPO_DIR` is the result of:
319 ### "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
320 - name: cloned_fleet_folder_name
327 image: ttl.sh/osm-krm-functions:24h
328 # imagePullPolicy: Always
330 - name: SECRET_VALUES
333 name: "{{inputs.parameters.reference_secret_for_values}}"
334 key: "{{inputs.parameters.reference_key_for_values}}"
338 value: "{{inputs.parameters.debug}}"
339 command: ["/app/scripts/entrypoint.sh"]
341 - create_generated_ksu_from_helm_into_profile
342 - "{{inputs.parameters.helmrelease_name}}"
343 - "{{inputs.parameters.chart_name}}"
344 - "{{inputs.parameters.chart_version}}"
345 - "{{inputs.parameters.target_ns}}"
346 - "{{inputs.parameters.create_ns}}"
347 - "{{inputs.parameters.is_preexisting_repo}}"
348 - "{{inputs.parameters.helmrepo_name}}"
349 - "{{inputs.parameters.helmrepo_url}}"
350 - "{{inputs.parameters.helmrepo_ns}}"
351 - "{{inputs.parameters.helmrepo_secret_ref}}"
352 - "{{inputs.parameters.inline_values}}"
353 - "{{inputs.parameters.is_preexisting_secret}}"
354 - "{{inputs.parameters.values_secret_name}}"
355 - "{{inputs.parameters.secret_key}}"
356 - "{{inputs.parameters.age_public_key}}"
358 - "{{inputs.parameters.is_preexisting_cm}}"
359 - "{{inputs.parameters.values_cm_name}}"
360 - "{{inputs.parameters.cm_key}}"
361 - "{{inputs.parameters.cm_values}}"
362 - "{{inputs.parameters.ksu_name}}"
363 - "{{inputs.parameters.profile_name}}"
364 - "{{inputs.parameters.profile_type}}"
365 - "{{inputs.parameters.project_name}}"
366 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
367 - "{{inputs.parameters.sync}}"
370 mountPath: '{{inputs.parameters.fleet_mount_path}}'
373 persistentVolumeClaim:
374 claimName: '{{inputs.parameters.fleet_volume_name}}'
381 # Update a "generated" KSU from `HelmRelease` and Source Repo definitions
382 - name: update-ksu-generated-hr
385 # References to required external resources
386 - name: fleet_volume_name
387 - name: fleet_mount_path
389 # HelmRelease generation
390 - name: helmrelease_name
392 - name: chart_version
395 # Repo source generation
396 - name: is_preexisting_repo
398 - name: helmrepo_name
402 expression: "{{input.parameters.target_ns}}"
403 - name: helmrepo_secret_ref
404 # HelmRelease inline values (if any)
405 - name: inline_values
407 # Secret reference and generation (if required)
408 - name: is_preexisting_secret
410 - name: values_secret_name
413 - name: age_public_key
414 ## Secret values will be obtained from the
415 ## secret named after the input parameter `reference_secret_for_values`,
416 ## and from the key named after the input parameter `reference_key_for_values`
417 - name: reference_secret_for_values
418 - name: reference_key_for_values
419 # ConfigMap reference and generation (if required)
420 - name: is_preexisting_cm
422 - name: values_cm_name
433 ## Root folder of the cloned Fleet repo - Do not touch
434 ### `FLEET_REPO_DIR` is the result of:
435 ### "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
436 - name: cloned_fleet_folder_name
443 image: ttl.sh/osm-krm-functions:24h
444 # imagePullPolicy: Always
446 - name: SECRET_VALUES
449 name: "{{inputs.parameters.reference_secret_for_values}}"
450 key: "{{inputs.parameters.reference_key_for_values}}"
454 value: "{{inputs.parameters.debug}}"
455 command: ["/app/scripts/entrypoint.sh"]
457 - update_generated_ksu_from_helm_into_profile
458 - "{{inputs.parameters.helmrelease_name}}"
459 - "{{inputs.parameters.chart_name}}"
460 - "{{inputs.parameters.chart_version}}"
461 - "{{inputs.parameters.target_ns}}"
462 - "{{inputs.parameters.create_ns}}"
463 - "{{inputs.parameters.is_preexisting_repo}}"
464 - "{{inputs.parameters.helmrepo_name}}"
465 - "{{inputs.parameters.helmrepo_url}}"
466 - "{{inputs.parameters.helmrepo_ns}}"
467 - "{{inputs.parameters.helmrepo_secret_ref}}"
468 - "{{inputs.parameters.inline_values}}"
469 - "{{inputs.parameters.is_preexisting_secret}}"
470 - "{{inputs.parameters.values_secret_name}}"
471 - "{{inputs.parameters.secret_key}}"
472 - "{{inputs.parameters.age_public_key}}"
474 - "{{inputs.parameters.is_preexisting_cm}}"
475 - "{{inputs.parameters.values_cm_name}}"
476 - "{{inputs.parameters.cm_key}}"
477 - "{{inputs.parameters.cm_values}}"
478 - "{{inputs.parameters.ksu_name}}"
479 - "{{inputs.parameters.profile_name}}"
480 - "{{inputs.parameters.profile_type}}"
481 - "{{inputs.parameters.project_name}}"
482 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
485 mountPath: '{{inputs.parameters.fleet_mount_path}}'
488 persistentVolumeClaim:
489 claimName: '{{inputs.parameters.fleet_volume_name}}'
496 # Delete a KSU from a profile
500 # References to required external resources
501 - name: fleet_volume_name
502 - name: fleet_mount_path
504 - name: sw_catalogs_volume_name
505 - name: sw_catalogs_mount_path
506 value: "/sw-catalogs"
507 # Specific parameters - KSU id
513 # Other parameters - Do not touch
514 - name: cloned_fleet_folder_name
516 - name: cloned_sw_catalogs_folder_name
517 value: "sw-catalogs-osm"
522 image: ttl.sh/osm-krm-functions:24h
523 # imagePullPolicy: Always
526 value: "{{inputs.parameters.debug}}"
527 command: ["/app/scripts/entrypoint.sh"]
529 - delete_ksu_from_profile
530 - "{{inputs.parameters.ksu_name}}"
531 - "{{inputs.parameters.profile_name}}"
532 - "{{inputs.parameters.profile_type}}"
533 - "{{inputs.parameters.project_name}}"
534 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
537 mountPath: '{{inputs.parameters.fleet_mount_path}}'
538 - name: sw-catalogs-repo-volume
539 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
542 persistentVolumeClaim:
543 claimName: '{{inputs.parameters.fleet_volume_name}}'
544 - name: sw-catalogs-repo-volume
545 persistentVolumeClaim:
546 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
553 # Clone a KSU from a profile to another
557 # References to required external resources
558 - name: fleet_volume_name
559 - name: fleet_mount_path
561 # Specific parameters - Source and destination KSU
563 - name: source_ksu_name
564 - name: source_profile_name
565 - name: source_profile_type
566 - name: source_project_name
569 ## - If any of the destination parameters are not specified, it will assume
570 ## they are the same as in source.
571 ## - It will reject if all are empty or equal to source, to avoid cloning a KSU over itself
572 - name: destination_ksu_name
574 - name: destination_profile_name
576 - name: destination_profile_type
578 - name: destination_project_name
580 # Other parameters - Do not touch
581 - name: cloned_fleet_folder_name
587 image: ttl.sh/osm-krm-functions:24h
588 # imagePullPolicy: Always
591 value: "{{inputs.parameters.debug}}"
592 command: ["/app/scripts/entrypoint.sh"]
595 - "{{inputs.parameters.source_ksu_name}}"
596 - "{{inputs.parameters.source_profile_name}}"
597 - "{{inputs.parameters.source_profile_type}}"
598 - "{{inputs.parameters.source_project_name}}"
599 - "{{inputs.parameters.destination_ksu_name}}"
600 - "{{inputs.parameters.destination_profile_name}}"
601 - "{{inputs.parameters.destination_profile_type}}"
602 - "{{inputs.parameters.destination_project_name}}"
603 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
606 mountPath: '{{inputs.parameters.fleet_mount_path}}'
609 persistentVolumeClaim:
610 claimName: '{{inputs.parameters.fleet_volume_name}}'
617 # Read template folder from OKA Package and convert to `ResourceList`
618 # It can work as KRM generator function, since it accepts an optional input `ResourceList`
622 # References to required external resources
623 - name: sw_catalogs_volume_name
624 - name: temp_volume_name
625 # Filename for input stream
626 - name: input_stream_file
628 # Specific parameters
629 ## Relative path from `sw_catalogs_mount_path`
630 - name: templates_path
631 ## Should substitute environment variables in the template?
632 - name: substitute_environment
634 ## Filter for substitution of environment variables
635 - name: substitution_filter
637 ## Custom environment variables (formatted as .env), to be used for template parametrization
638 - name: custom_env_vars
646 # Other parameters - Do not touch
647 - name: sw_catalogs_mount_path
648 value: "/sw-catalogs"
649 - name: cloned_sw_catalogs_folder_name
650 value: "sw-catalogs-osm"
652 value: "{{=sprig.randAlphaNum(9)}}"
656 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
658 image: ttl.sh/osm-krm-functions:24h
659 # imagePullPolicy: Always
662 value: "{{inputs.parameters.input_stream_file}}"
664 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
666 value: "{{inputs.parameters.custom_env_vars}}"
668 value: "{{inputs.parameters.debug}}"
669 command: ["/app/scripts/entrypoint.sh"]
671 - folder2list_generator
672 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}/{{inputs.parameters.templates_path}}"
673 - "{{inputs.parameters.substitute_environment}}"
674 - "{{inputs.parameters.substitution_filter}}"
677 mountPath: "/results"
678 - name: sw-catalogs-repo-volume
679 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
682 persistentVolumeClaim:
683 claimName: '{{inputs.parameters.temp_volume_name}}'
684 - name: sw-catalogs-repo-volume
685 persistentVolumeClaim:
686 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
693 # Transform `ResourceList`'s main Kustomization to patch `HelmRelease` to use
695 - name: transform-ks-add-values-to-hr
698 # References to required external resources
699 - name: temp_volume_name
700 # Specific parameters - Generator
701 ## Filename for input stream
702 - name: input_stream_file
703 # Specific parameters
705 - name: kustomization_name
706 - name: helmrelease_name
707 ## Input values for the Helm Chart
708 - name: inline_values
712 # Other parameters - Do not touch
714 value: "{{=sprig.randAlphaNum(9)}}"
718 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
720 image: ttl.sh/osm-krm-functions:24h
721 # imagePullPolicy: Always
724 value: "{{inputs.parameters.input_stream_file}}"
726 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
728 value: "{{inputs.parameters.debug}}"
729 command: ["/app/scripts/entrypoint.sh"]
731 - add_values_to_helmrelease_via_ks
732 - "{{inputs.parameters.kustomization_name}}"
733 - "{{inputs.parameters.helmrelease_name}}"
734 - "{{inputs.parameters.inline_values}}"
737 mountPath: "/results"
740 persistentVolumeClaim:
741 claimName: '{{inputs.parameters.temp_volume_name}}'
748 # Transform `ResourceList`'s main Kustomization to patch `HelmRelease` to use
749 # values from a Secret, a ConfigMap or both.
750 - name: transform-ks-add-referenced-values-to-hr
753 # References to required external resources
754 - name: temp_volume_name
755 # Specific parameters - Generator
756 ## Filename for input stream
757 - name: input_stream_file
758 # Specific parameters
759 - name: kustomization_name
760 - name: helmrelease_name
761 ## Source for values (Secret, ConfigMap or both)
762 - name: values_secret_name
764 - name: values_cm_name
769 # Other parameters - Do not touch
771 value: "{{=sprig.randAlphaNum(9)}}"
775 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
777 image: ttl.sh/osm-krm-functions:24h
778 # imagePullPolicy: Always
781 value: "{{inputs.parameters.input_stream_file}}"
783 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
785 value: "{{inputs.parameters.debug}}"
786 command: ["/app/scripts/entrypoint.sh"]
788 - add_ref_values_to_hr_via_ks
789 - "{{inputs.parameters.kustomization_name}}"
790 - "{{inputs.parameters.helmrelease_name}}"
791 - "{{inputs.parameters.values_secret_name}}"
792 - "{{inputs.parameters.values_cm_name}}"
795 mountPath: "/results"
798 persistentVolumeClaim:
799 claimName: '{{inputs.parameters.temp_volume_name}}'
806 # KRM function to render a ResourceList with a KSU into a target profile
807 - name: render-ksu-into-profile
810 # References to required external resources
811 - name: fleet_volume_name
812 - name: temp_volume_name
813 # Filename for input stream
814 - name: input_stream_file
815 # Specific parameters
821 ## Whether the target KSU folder will be fully re-created on render
827 # Other parameters - Do not touch
828 - name: fleet_mount_path
830 - name: fleet_repo_dir
831 value: "/fleet/fleet-osm/"
833 value: "{{=sprig.randAlphaNum(9)}}"
837 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
839 image: ttl.sh/osm-krm-functions:24h
840 # imagePullPolicy: Always
843 value: "{{inputs.parameters.input_stream_file}}"
845 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
847 value: "{{inputs.parameters.debug}}"
848 command: ["/app/scripts/entrypoint.sh"]
850 - render_ksu_into_profile
851 - "{{inputs.parameters.ksu_name}}"
852 - "{{inputs.parameters.profile_name}}"
853 - "{{inputs.parameters.profile_type}}"
854 - "{{inputs.parameters.project_name}}"
855 - "{{inputs.parameters.fleet_repo_dir}}"
856 - "{{inputs.parameters.sync}}"
859 mountPath: "/results"
861 mountPath: '{{inputs.parameters.fleet_mount_path}}'
864 persistentVolumeClaim:
865 claimName: '{{inputs.parameters.temp_volume_name}}'
867 persistentVolumeClaim:
868 claimName: '{{inputs.parameters.fleet_volume_name}}'
875 # KRM generator to create Secrets suitable to pass values to `HelmReleases`
876 - name: generator-secret-hr-values
879 # References to required external resources
880 - name: temp_volume_name
881 # Specific parameters - Generator
882 ## Filename for input stream
883 - name: input_stream_file
885 ## Name of final manifest filename into generated `ResourceList` object
886 - name: final_manifest_filename
887 # Specific parameters - Secret
888 - name: age_public_key
889 - name: values_secret_name
891 - name: reference_secret_for_values
892 - name: reference_key_for_values
902 parameter: '{{steps.generate-resourcelist.outputs.parameters.output_file}}'
904 - - name: build-manifest
906 name: ksu-management-wft
907 template: manifest-secret-hr-values
910 # References to required external resources
911 - name: temp_volume_name
912 value: "{{inputs.parameters.temp_volume_name}}"
913 # Specific parameters
914 - name: age_public_key
915 value: "{{inputs.parameters.age_public_key}}"
916 - name: values_secret_name
917 value: "{{inputs.parameters.values_secret_name}}"
919 value: "{{inputs.parameters.target_ns}}"
920 - name: reference_secret_for_values
921 value: "{{inputs.parameters.reference_secret_for_values}}"
922 - name: reference_key_for_values
923 value: "{{inputs.parameters.reference_key_for_values}}"
925 value: "{{inputs.parameters.secret_key}}"
928 value: "{{inputs.parameters.debug}}"
929 - - name: generate-resourcelist
931 name: ksu-management-wft
932 template: make-generator
935 # References to required external resources
936 - name: temp_volume_name
937 value: "{{inputs.parameters.temp_volume_name}}"
938 # Filename for input stream
939 - name: input_stream_file
940 value: "{{inputs.parameters.input_stream_file}}"
941 # File with raw manifest
942 - name: input_manifest_file
943 value: '{{steps.build-manifest.outputs.parameters.output_file}}'
944 # Name of final manifest filename into generated `ResourceList` object
945 - name: final_manifest_filename
946 value: "{{inputs.parameters.final_manifest_filename}}"
949 value: "{{inputs.parameters.debug}}"
952 # KRM generator to create ConfigMaps suitable to pass values to `HelmReleases`
953 - name: generator-cm-hr-values
956 # References to required external resources
957 - name: temp_volume_name
958 # Specific parameters - Generator
959 ## Filename for input stream
960 - name: input_stream_file
962 ## Name of final manifest filename into generated `ResourceList` object
963 - name: final_manifest_filename
964 # Specific parameters - ConfigMap
965 - name: values_cm_name
977 parameter: '{{steps.generate-resourcelist.outputs.parameters.output_file}}'
979 - - name: build-manifest
981 name: ksu-management-wft
982 template: manifest-cm-hr-values
985 # References to required external resources
986 - name: temp_volume_name
987 value: "{{inputs.parameters.temp_volume_name}}"
988 # Specific parameters
989 - name: values_cm_name
990 value: "{{inputs.parameters.values_cm_name}}"
992 value: "{{inputs.parameters.target_ns}}"
994 value: "{{inputs.parameters.cm_key}}"
996 value: "{{inputs.parameters.cm_values}}"
999 value: "{{inputs.parameters.debug}}"
1000 - - name: generate-resourcelist
1002 name: ksu-management-wft
1003 template: make-generator
1006 # References to required external resources
1007 - name: temp_volume_name
1008 value: "{{inputs.parameters.temp_volume_name}}"
1009 # Filename for input stream
1010 - name: input_stream_file
1011 value: "{{inputs.parameters.input_stream_file}}"
1012 # File with raw manifest
1013 - name: input_manifest_file
1014 value: '{{steps.build-manifest.outputs.parameters.output_file}}'
1015 # Name of final manifest filename into generated `ResourceList` object
1016 - name: final_manifest_filename
1017 value: "{{inputs.parameters.final_manifest_filename}}"
1020 value: "{{inputs.parameters.debug}}"
1023 # Converts a manifest to a KRM generator
1024 - name: make-generator
1027 # References to required external resources
1028 - name: temp_volume_name
1029 # Filename for input stream
1030 - name: input_stream_file
1032 # File with raw manifest
1033 - name: input_manifest_file
1034 # Name of final manifest filename into generated `ResourceList` object
1035 - name: final_manifest_filename
1039 # Other parameters - Do not touch
1041 value: "{{=sprig.randAlphaNum(9)}}"
1045 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
1047 image: ttl.sh/osm-krm-functions:24h
1048 # imagePullPolicy: Always
1051 value: "{{inputs.parameters.input_stream_file}}"
1053 value: "/results/resourcelist.{{inputs.parameters.rand_str}}.yaml"
1055 value: "{{inputs.parameters.debug}}"
1056 command: ["/app/scripts/entrypoint.sh"]
1059 - "{{inputs.parameters.final_manifest_filename}}"
1061 - "{{inputs.parameters.input_manifest_file}}"
1064 mountPath: "/results"
1067 persistentVolumeClaim:
1068 claimName: '{{inputs.parameters.temp_volume_name}}'
1075 # Produces a secret manifest and encrypts it with SOPS
1076 - name: manifest-secret-hr-values
1079 # References to required external resources
1080 - name: temp_volume_name
1081 # Public age key to encrypt secret
1082 - name: age_public_key
1083 # Name of the secret to be created
1084 - name: values_secret_name
1085 # Namespace for the secret
1087 # Input secret that contains the values to embed into the new secret
1088 - name: reference_secret_for_values
1089 - name: reference_key_for_values
1090 value: "values.yaml"
1091 # Key in the new secret where the values will be inserted
1093 value: "values.yaml"
1097 # Other parameters - Do not touch
1099 value: "{{=sprig.randAlphaNum(9)}}"
1103 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1105 image: ttl.sh/osm-krm-functions:24h
1106 # imagePullPolicy: Always
1111 name: "{{inputs.parameters.reference_secret_for_values}}"
1112 key: "{{inputs.parameters.reference_key_for_values}}"
1114 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1116 value: "{{inputs.parameters.debug}}"
1117 command: ["/app/scripts/entrypoint.sh"]
1120 - "{{inputs.parameters.age_public_key}}"
1124 - "{{inputs.parameters.values_secret_name}}"
1125 - --namespace={{inputs.parameters.target_ns}}
1126 - --from-file={{inputs.parameters.secret_key}}=/dev/stdin
1131 mountPath: "/results"
1134 persistentVolumeClaim:
1135 claimName: '{{inputs.parameters.temp_volume_name}}'
1142 # Produces a ConfigMap manifest
1143 - name: manifest-cm-hr-values
1146 # References to required external resources
1147 - name: temp_volume_name
1148 # Specific parameters
1149 - name: values_cm_name
1152 value: "values.yaml"
1157 # Other parameters - Do not touch
1159 value: "{{=sprig.randAlphaNum(9)}}"
1163 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1165 image: ttl.sh/osm-krm-functions:24h
1166 # imagePullPolicy: Always
1169 value: "{{inputs.parameters.cm_values}}"
1171 value: "/results/manifest.{{inputs.parameters.rand_str}}.yaml"
1173 value: "{{inputs.parameters.debug}}"
1174 command: ["/app/scripts/entrypoint.sh"]
1179 - "{{inputs.parameters.values_cm_name}}"
1180 - --namespace={{inputs.parameters.target_ns}}
1181 - --from-file={{inputs.parameters.cm_key}}=/dev/stdin
1186 mountPath: "/results"
1189 persistentVolumeClaim:
1190 claimName: '{{inputs.parameters.temp_volume_name}}'