# Converting from docker-compose

If you normally stand up your deployment or dev environment with docker-compose, you can convert your docker-compose.yaml file to a Helm chart using [Kompose](https://kompose.io).

To install Kompose (assuming you are on macOS and have [Homebrew](https://brew.sh/) installed):

```bash
brew install kompose
```

{% hint style="info" %}
If you need instructions for a different platform or do not have access to Homebrew, please contact Metamanagement directly.
{% endhint %}

Once Kompose is installed, you need to add some labels to your docker-compose.yaml, so Kompose knows how to create your Kubernetes services. Under any service that is meant to be exposed to your users (i.e. as a web service), add `kompose.service.type: nodeport` and `kompose.service.expose: "true"`:

```yaml
services: 
  web-service:
    <...>:
    labels:
      kompose.service.type: nodeport
      kompose.service.expose: "true"
```

For more details on the types of labels that you can add and for more advanced configuration, please take a look at the [Kompose User Guide](https://kompose.io/user-guide/#labels).

To then convert docker-compose.yaml into a Helm Chart, you run:

```
kompose convert -c
```

By default, this will create your Helm Chart in a folder called `docker-compose/`. In `docker-compose/Chart.yaml`, you should update the `name` field to match whatever you want the name of the chart to be. You can then rename the `docker-compose/` folder as you see fit.<br>

### Pointing at the right containers

Depending on how your docker-compose.yaml is set up, your newly created Helm Chart may not be pointing to a container registry where your images are hosted. To double-check, take a look at all of the files in `<chart-folder>/templates/` of the form `*-deployment.yaml`, and search for the `image:` label. If the images specified are the ones in your cloud container registry, then all is well. To push your containers to the Google Cloud Registry, please see the following [instructions](https://cloud.google.com/container-registry/docs/pushing-and-pulling).

{% hint style="info" %}
Metamanagement recommends using Google Cloud Registry as GCR has a reasonable story for provisioning authentication credentials for use in all Kubernetes environments. If you must use a different container registry, please contact Metamanagement directly.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.metamanagement.dev/products/helm-charts/docker-compose.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
