Use Codefresh Kompose plugin to deploy or convert a Docker Compose file into Kubernetes resources.
Set required and optional environment variable and add the following step to your Codefresh pipeline:
---
version: '1.0'
steps:
...
release_to_env:
image: codefresh/plugin-kompose:v1.5.0
...
- required
KUBE_CONTEXT
- Kubernetes context to use FILE
- Docker Compose file to deploy (defaultdocker-compose.yaml
file)NAMESPACE
- target Kubernetes namespace (defaultdefault
namespace)REPLICAS
- specify the number of replicas generated (default1
)VOLUMES
- volumes to be generated (persistentVolumeClaim
|emptyDir
) (defaultpersistentVolumeClaim
)DRY_RUN
- do a "dry run" (print out) deployment (do not install anything, useful for Debug)DEBUG
- print verbose install output
Add Kubernetes integration to Codefresh: > Account Settings > Integration > Kubernetes
. From now on, you can use added Kubernetes cluster in Codefresh pipeline, addressing its context by the name you see in Clusters
menu.
Use docker build
command to build the plugin.
Two build arguments can be provided to override default kubectl
, helm
and kompose
version:
HELM_VERSION
- default tolatest
KOMPOSE_VERSION
- default tov1.5.0