一、下载
下载地址:https://github.com/kubernetes/kompose/releases/
Linux 下执行以下命令下载:
curl -L https://github.com/kubernetes/kompose/releases/download/v1.26.1/kompose-linux-amd64 -o kompose
二、授予执行权限
chmod +x kompose
三、移至 /usr/local/bin 目录下
sudo mv ./kompose /usr/local/bin/kompose
四、使用
在 docker-compose.yaml 所在目录下执行:
kompose convert
输出如下:
[root@master01 compose]# kompose convert
WARN Volume mount on the host "/etc/kubernetes/volumes/data/es7/logs" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/volumes/data/es7/data" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/compose/config/ik" isn't supported - ignoring path on the host
INFO Network stack is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
INFO Network stack is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
WARN Volume mount on the host "/etc/kubernetes/compose/config/logstash-springboot.conf" isn't supported - ignoring path on the host
INFO Network stack is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
WARN Volume mount on the host "/etc/kubernetes/volumes/data/mysqldata" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/compose/config/my.cnf" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/compose/init/mysql" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/volumes/data/redsidata" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/volumes/data/rocket/broker/logs" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/volumes/data/rocket/broker/store" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/compose/config/broker.conf" isn't supported - ignoring path on the host
INFO Network rocketmq is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
INFO Network rocketmq is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
WARN Volume mount on the host "/etc/kubernetes/volumes/data/rocket/server/logs" isn't supported - ignoring path on the host
WARN Volume mount on the host "/etc/kubernetes/volumes/data/rocket/server/store" isn't supported - ignoring path on the host
INFO Network rocketmq is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
WARN Volume mount on the host "/etc/kubernetes/volumes/data/xxl-job" isn't supported - ignoring path on the host
INFO Kubernetes file "elasticsearch-service.yaml" created
INFO Kubernetes file "kibana-service.yaml" created
INFO Kubernetes file "logstash-service.yaml" created
INFO Kubernetes file "mysql-service.yaml" created
INFO Kubernetes file "redis-service.yaml" created
INFO Kubernetes file "rmqbroker-service.yaml" created
INFO Kubernetes file "rmqconsole-service.yaml" created
INFO Kubernetes file "rmqnamesrv-service.yaml" created
INFO Kubernetes file "xxl-job-service.yaml" created
INFO Kubernetes file "elasticsearch-deployment.yaml" created
INFO Kubernetes file "elasticsearch-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "elasticsearch-claim1-persistentvolumeclaim.yaml" created
INFO Kubernetes file "elasticsearch-claim2-persistentvolumeclaim.yaml" created
INFO Kubernetes file "stack-networkpolicy.yaml" created
INFO Kubernetes file "kibana-deployment.yaml" created
INFO Kubernetes file "logstash-deployment.yaml" created
INFO Kubernetes file "logstash-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "mysql-deployment.yaml" created
INFO Kubernetes file "mysql-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "mysql-claim1-persistentvolumeclaim.yaml" created
INFO Kubernetes file "mysql-claim2-persistentvolumeclaim.yaml" created
INFO Kubernetes file "redis-deployment.yaml" created
INFO Kubernetes file "redis-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "rmqbroker-deployment.yaml" created
INFO Kubernetes file "rmqbroker-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "rmqbroker-claim1-persistentvolumeclaim.yaml" created
INFO Kubernetes file "rmqbroker-claim2-persistentvolumeclaim.yaml" created
INFO Kubernetes file "rocketmq-networkpolicy.yaml" created
INFO Kubernetes file "rmqconsole-deployment.yaml" created
INFO Kubernetes file "rmqnamesrv-deployment.yaml" created
INFO Kubernetes file "rmqnamesrv-claim0-persistentvolumeclaim.yaml" created
INFO Kubernetes file "rmqnamesrv-claim1-persistentvolumeclaim.yaml" created
INFO Kubernetes file "xxl-job-deployment.yaml" created
INFO Kubernetes file "xxl-job-claim0-persistentvolumeclaim.yaml" created