Introduction
Have a nice try
Install
The installation is very simple, just download a binary directly
wget https://github.com/kubernetes/kompose/releases/download/v1.26.1/kompose-linux-amd64.tar.gz
tar -zxvf kompose-linux-amd64.tar.gz
mv kompose-linux-amd64 /bin/kompose
use
First prepare a docker-compose file
1 |
version: "3" |
execute directly after
kompose convert
Enough
If your file is not docker-compose.yaml
, you can use the -f
parameter to get the specified file name
The resource file generated in this way will be brought with it by default.
1 |
annotations: |
these two annotations
You can do this if you don’t want to
./kompose-linux-amd64 convert -f docker-compose.yaml --with-kompose-annotation=false
The default converted from kompose is deployment. Of course, if you want to convert to daemonset, you can use the following parameters
--controller=daemonSet
If you don’t want to generate a file, you can use the following parameters to output directly to the screen
--stdout
say a word
The quality of the conversion is OK, it can help the yaml engineer to write a few parameters less
Welcome to my blog www.bboy.app
Have Fun
This article is reprinted from: https://www.bboy.app/2022/05/09/%E4%BD%BF%E7%94%A8kompose%E6%8A%8Adocker-compose%E6%96%87%E4%BB% B6%E8%BD%AC%E6%8D%A2%E6%88%90k8s%E8%B5%84%E6%BA%90/
This site is for inclusion only, and the copyright belongs to the original author.