Skip to content

Add extension points to the BaseManifest repository#2

Merged
MoisesGSalas merged 1 commit into
mgs/base-manifestsfrom
mgs/extended-manifests
Jul 25, 2022
Merged

Add extension points to the BaseManifest repository#2
MoisesGSalas merged 1 commit into
mgs/base-manifestsfrom
mgs/extended-manifests

Conversation

@MoisesGSalas
Copy link
Copy Markdown
Member

@MoisesGSalas MoisesGSalas commented Jul 20, 2022

Description

This adds an additional manifest builder that creates an additional overlay on top of the ones generated by BaseManifests. ExtendedManifests will take the path defined in extra_templates in your drydock reference and render the templates living there on to your drydock-env.

How to use

  1. Modify you reference to include:
  manifest_class: drydock.manifest_builder.infrastructure.tutor_based_manifests.ExtendedManifest
  manifest_options:
    extra_templates: extra_templates_root
  1. Create the directories extra_templates_root/extra-extensions and add a kustomization.yml with you additional resources. Remember that this is a template and you have access to all the variables (e.g. {{ K8S_NAMESPACE }}).
  2. Run tutor drydock save -r reference.yml to generate the new environment.

@MoisesGSalas MoisesGSalas force-pushed the mgs/base-manifests branch 3 times, most recently from dd494c1 to e449d41 Compare July 25, 2022 11:52
@MoisesGSalas MoisesGSalas force-pushed the mgs/extended-manifests branch from 1327ffc to 381c0ea Compare July 25, 2022 11:56
@MoisesGSalas MoisesGSalas requested a review from a team July 25, 2022 12:28
@MoisesGSalas MoisesGSalas marked this pull request as ready for review July 25, 2022 12:28

hooks.Filters.ENV_PATCH("drydock-kustomization-resources").add_item(f"- {self.EXTENSIONS_DIRECTORY}")

self.base_manifests.save(config)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it necessary to save twice? Here and when rendering

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the cleanest approach at the moment, but I use it to generate two different environments with different templates and merge them.

Comment thread README.rst Outdated
Where ``extra_templates_root`` points to the directory that holds your extra templates.
In ``extra_templates_root`` you must include an directory named ``extra-extensions``.
Inside ``extra-extensions`` you can write any template that you want but is meant to
be used as a Kustomize overlay, therefore you will need atleast a Kustomization.yml file.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be used as a Kustomize overlay, therefore you will need atleast a Kustomization.yml file.
be used as a Kustomize overlay, therefore you will need at least a Kustomization.yml file.

@MoisesGSalas MoisesGSalas force-pushed the mgs/extended-manifests branch from 381c0ea to 13e2a2b Compare July 25, 2022 15:31
@MoisesGSalas MoisesGSalas merged commit 50b3e8c into mgs/base-manifests Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants