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

docs: Document base image settings and remove docs for deprecated template/rollout settings #3871

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions docs/concepts-basics/docker-compose-yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,23 @@ Please note that service names adhere to the [RFC 1035](https://tools.ietf.org/h

#### `build`

If you want Lagoon to build a Dockerfile for your service during every deployment, you can define it here:
If you want Lagoon to build an image for your service during every deployment, you can define it here:

`build`

* `context`
* The build context path that should be passed on into the `docker build` command.
* `dockerfile:`
* Location and name of the Dockerfile that should be built.
* `context`: The build context path that should be passed on into the `docker build` command.
* `dockerfile`: Location and name of the Dockerfile that should be built.

!!! warning
Lagoon does NOT support the short version of `build: <Dockerfile>` and will fail if it finds such a definition.

If your are building a derived image and need to ensure the base image is always updated, add the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If your are building a derived image and need to ensure the base image is always updated, add the
If you are building a derived image and need to ensure the base image is always updated, add the

base image as a label for the service: `lagoon.base.image: container.reg/my/baseimage:latest`. The
value supports environment variable replacement, for example `baseimage:${MY_BASEIMAGE_TAG:-latest}`.

#### `image`

If you don't need to build a Dockerfile and just want to use an existing Dockerfile, define it via `image`.
If you want to use an existing image, instead of building one, define it via `image`.

### Types

Expand Down Expand Up @@ -352,21 +354,6 @@ In the example above, the services are named `nginx` and `php` (but you can call

In order for Lagoon to realize which one is the `nginx` and which one is the `php` service, we define it via `lagoon.deployment.servicetype: nginx` and `lagoon.deployment.servicetype: php`.

## Helm Templates (Kubernetes only)

Lagoon uses [Helm](https://helm.sh/) for templating on Kubernetes. To do this, a series of [Charts](https://github.com/uselagoon/build-deploy-tool/tree/main/legacy/helmcharts) are included with the `build-deploy-tool` image.

## Custom Rollout Monitor Types

By default, Lagoon expects that services from custom templates are rolled out via a [`DeploymentConfig`](https://docs.openshift.com/container-platform/4.4/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are) object within Kubernetes or Openshift. It monitors the rollout based on this object. In some cases, the services that are defined via custom deployment need a different way of monitoring. This can be defined via `lagoon.rollout`:

* `deploymentconfig` - This is the default. Expects a [`DeploymentConfig`](https://docs.openshift.com/container-platform/4.4/applications/deployments/what-deployments-are.html#deployments-and-deploymentconfigs_what-deployments-are) object in the template for the service.
* `statefulset` - Expects a [`Statefulset`](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) object in the template for the service.
* `daemonset` - Expects a [`Daemonset`](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) object in the template for the service.
* `false` - Will not monitor any rollouts, and will just be happy if the template applies and does not throw any errors.

You can also overwrite the rollout for just one specific environment. This is done in [`.lagoon.yml`](lagoon-yml.md#environmentsnamerollouts).

## Docker Compose v2 compatibility

!!! bug
Expand Down Expand Up @@ -435,3 +422,10 @@ The corrected version combines both aliases into a single mapping key - you'll n
<< : [*default-volumes, *default-user]
...
```

## Deprecated

These settings have been deprecated and should be removed from use in your `docker-compose.yml`.

* `services.[name].labels.lagoon.rollout`
* `services.[name].labels.lagoon.template`
47 changes: 3 additions & 44 deletions docs/concepts-basics/lagoon-yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,46 +512,6 @@ environments:
mariadb: mariadb-single
```

### `environments.[name].templates`

The Lagoon build process checks the `lagoon.template` label from the `docker-compose.yml` file in order to check if the service needs a custom template file \(read more about them in the [documentation of `docker-compose.yml`](docker-compose-yml.md)\).

Sometimes you might want to override the **template** just for a single environment, and not for all of them:

`service-name: template-file`

* `service-name` is the name of the service from `docker-compose.yml` you would like to override.
* `template-file` is the path and name of the template to use for this service in this environment.

#### Example Template Override

```yaml title=".lagoon.yml"
environments:
main:
templates:
mariadb: mariadb.main.deployment.yml
```

### `environments.[name].rollouts`

The Lagoon build process checks the `lagoon.rollout` label from the `docker-compose.yml` file in order to check if the service needs a special rollout type \(read more about them in the [documentation of `docker-compose.yml`](docker-compose-yml.md#custom-rollout-monitor-types)\)

Sometimes you might want to override the **rollout type** just for a single environment, especially if you also overwrote the template type for the environment:

`service-name: rollout-type`

* `service-name` is the name of the service from `docker-compose.yml` you would like to override.
* `rollout-type` is the type of rollout. See [documentation of `docker-compose.yml`](docker-compose-yml.md#custom-rollout-monitor-types)\) for possible values.

#### Custom Rollout Type Example

```yaml title=".lagoon.yml"
environments:
main:
rollouts:
mariadb: statefulset
```

### `environments.[name].autogenerateRoutes`

This allows for any environments to get autogenerated routes when route autogeneration is disabled.
Expand Down Expand Up @@ -819,10 +779,6 @@ environments:
- www.example.ch
types:
mariadb: mariadb
templates:
mariadb: mariadb.main.deployment.yml
rollouts:
mariadb: statefulset
cronjobs:
- name: drush cron
schedule: "M * * * *" # This will run the cron once per hour.
Expand Down Expand Up @@ -851,7 +807,10 @@ These settings have been deprecated and should be removed from use in your `.lag
The `None` option is equivalent to `Redirect`.

* `environments.[name].monitoring_urls`
* `environments.[name].rollouts`
* `environments.[name].routes.[service].[route].hsts`
* `environments.[name].routes.[service].[route].insecure`

The `None` option is equivalent to `Redirect`.

* `environments.[name].templates`
Loading