Skip to content

ureuzy/esopmok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esopmok

License: MIT

esopmok does the opposite of Kompose. That is, it converts the kubernetes manifest to docker-compose.yml

demo

🚀 Quick Start

Install Krew

https://krew.sigs.k8s.io/docs/user-guide/setup/install/

Install kubectl-esopmok

Binary Download here

$ mv kubectl-esopmok ~/.krew/bin

Usage

$ kubectl esopmok --help
Convert kubernetes manifest to docker-compose.yml

Usage:
  kubectl-esopmok [flags]

Examples:
kubectl esopmok deploy [deployment name]

As an example, convert the Grafana Deployment to docker-compose.yml.

$ kubectl get deploy grafana
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
grafana   1/1     1            1           85d

To convert, enter the following command.

$ kubectl esopmok deploy grafana
name: esopmok
services:
    grafana-download-dashboards:
        command:
            - /bin/sh
        deploy:
            replicas: 1
        image: curlimages/curl:7.85.0
        pull_policy: if_not_present
        volumes:
            - type: volume
              source: config
              target: /etc/grafana/download_dashboards.sh
            - type: volume
              source: storage
              target: /var/lib/grafana
            - type: volume
              source: auth-generic-oauth-secret-mount
              target: /etc/secrets/auth_generic_oauth
    grafana-grafana:
        deploy:
            replicas: 1
        environment:
            GF_PATHS_DATA: /var/lib/grafana/
            GF_PATHS_LOGS: /var/log/grafana
            GF_PATHS_PLUGINS: /var/lib/grafana/plugins
            GF_PATHS_PROVISIONING: /etc/grafana/provisioning
            GF_SECURITY_ADMIN_PASSWORD: ""

~~~

Additionally, it can be run as follows

$ kubectl esopmok deploy grafana | docker compose -f - up