Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrapping Companions #146

Open
1 of 4 tasks
schrieveslaach opened this issue Nov 30, 2023 · 1 comment
Open
1 of 4 tasks

Bootstrapping Companions #146

schrieveslaach opened this issue Nov 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@schrieveslaach
Copy link
Contributor

schrieveslaach commented Nov 30, 2023

The support of companions is very limited and is less capable of Docker Compose or Kubernetes files. For example, it is possible to specific files that will be put into the container but something like an additional job is impossible (some applications may rely on a oneshot database migration). This limitation restricts the use of PREvant to simple applications but applications composed of multiple complex applications are impossible to manage on PREvant.

Thus PREvant should be able to bootstrap the companions with a predefined set of configuration files (docker compose or Kubernetes files). Each infrastructure type can start an external container based on an OCI images that generates the desired file format. This format will be parsed and merged with the defined deployment unit before it will be deployed.

  • Docker Compose bootstrapping
  • Kubernetes bootstrapping (Bootstrap Companions in Kubernetes Environments #156)
  • Feed companions back into the hooks.
  • Make sure to query the infrastructure for existing Traefik ingresses and only render link if the services have ingresses.
@schrieveslaach
Copy link
Contributor Author

On the architecture level PREvant's backends (Docker or Kubernetes) can start a set of containers that receive a configurable and templated list of arguments and then the containers pipe some Docker Compose or Kubernetes manifest into STDOUT. This can then be used by PREvant to have an set of companions and other configurations (such as volume mappings, see #123) in place. So, applications that can be expressed on Docker Compose or Kubernetes manifest could be deployment and enriched by PREvant.

The payload that PREvant receives in the request body will be merged into the parsed outputs and thus users can reconfigure certain values on the API level.

@schrieveslaach schrieveslaach added the enhancement New feature or request label Dec 19, 2023
schrieveslaach added a commit that referenced this issue Jan 11, 2024
This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.
schrieveslaach added a commit that referenced this issue Jan 11, 2024
This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.
schrieveslaach added a commit that referenced this issue Jan 15, 2024
This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.
schrieveslaach added a commit that referenced this issue Jan 23, 2024
This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.
schrieveslaach added a commit that referenced this issue Jan 24, 2024
This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.
schrieveslaach added a commit that referenced this issue Jan 25, 2024
Bootstrap Companions in Kubernetes Environments

This commit introduces the configuration `bootstrapping.containers`
which provides a way to parse the configuration of application wide
companions because the current available configuration of companions if
quite limiting (Current backends, Docker and Kubernetes, offer way more
options than the PREvant configuration object allows). For example,
PREvant was limited to self-contained applications where each
microservice only relies on interactions via network API calls (REST,
database connections, messaging, etc.) With this commit PREvant is now
able to deploy application companions that are more powerful than the
PREvant configuration in Kubernetes backends.

If `bootstrapping.containers` is defined, PREvant will start one or more
containers on the infrastructure backend that are expected to generate
Kubernetes manifests as output on standard out (stdout) that will be
parsed by PREvant and supported are:

 - roles and role bindings
 - config maps and secrets
 - service accounts
 - persistent volume claims
 - services
 - pods, deployments, stateful sets, and jobs

Then before deploying these manifests PREvant merges all objects with
the objects generated from the HTTP request payload. Thus you can add or
overwrite configurations. For example, you can change the image used or
an environment variable. If you overwrite any configuration the
companion will be turned into an instance (as PREvant did before).

Ingresses won't be deployed if the bootstrap container outputs one of
these. Instead they will be parsed and if they use the ingress class
`nginx` they will be transformed into Traefik ingresses and middlewares
so that the microservices will be available via web interface.

This approach make #143 obsolete and fixes #123 and contributes to #146.

This commit also ensures that there are less requests to the Kubernetes API,
improving the performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant