Kompose is a open source tool that uses “docker-compose” file to deploy on kubernetes. Openshift is also Kubernetes based and Kompose is support Openshift too.
Parst of the Openshift series
- Part1: Install Opeshift
- Part2: How to Enable Auto Approval of CSR in Openshift v3.11
- Part3: Add new workers to Openshift cluster
- Part4: Chane the certificates of the Openshift cluster
- Part5: LDAP authentication for Openshift
- Part6: Keycloak SSO authentication for Openshift
- Part7: Gitlab SSO authentication for Openshift
- Part8a: Ceph persistent storage for Openshift
- Part8b: vSphere persistent storage for Openshift
- Part9: Helm on Openshift
- Part10: Tillerless Helm on Openshift
- Part11: Use external docker registry on Openshift
- Part12: Secondary route on Openshift
- Part13: Use Letsencrypt on Openshift
- Part14: Create Openshift operators
- Part15: Convert docker-compose file to Opeshift
Let’s say we have project with multiple microsevices that needs to deploy on Openshift and they have docker-compose.yml and Dockerfile. How do we deploy on Openshift?
Use Kompose to convert the docker-compose file to openshift compatible kubernetes config.
kompose convert -f docker-compose.yaml --provider=openshift
This command creates a separet yaml file for all kubernetes building block like “-imagestream.yaml”, “-service.yaml”, “-deploymentconfig.yaml” for each microservice. We can use these config files to deploy on Openshift easily.
kompose up --provider=openshift -f docker-compose.yml --build build-config --namespace=devopstales
If you have “build” option in docker-compose file, kompose automatically detects remote git url to deploy automatically.