# 配置转换工具
# Docker转DockerCompose
# DockerCompose转K8sYaml
# 安装
# Linux
curl -L https://oss.odboy.cn/blog/files/20024/kompose-linux-amd64 -o kompose
# Linux ARM64
curl -L https://oss.odboy.cn/blog/files/20024/kompose-linux-arm64 -o kompose
# macOS
curl -L https://oss.odboy.cn/blog/files/20024/kompose-darwin-amd64 -o kompose
# macOS ARM64
curl -L https://oss.odboy.cn/blog/files/20024/kompose-darwin-arm64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 使用
# 单文件
kompose convert -f redis-docker-compose.yaml
# 多文件
kompose convert -f redis-docker-compose.yaml -f mysql-docker-compose.yaml
kubectl apply -f .
kubectl get po
1
2
3
4
5
6
2
3
4
5
6