繁体   English   中英

在Kubernetes上运行的Docker-compose

[英]Docker-compose running on Kubernetes


我有一个在docker-compose上运行的网站。 一切正常,我使用Jenkins作为CI,当我提交代码时,Jenkins将docker-compose文件管理到正在运行的应用程序。
我想尝试Kubernetes并且想要学习它。 我没有找到用于docker-compose文件的好的解决方案。 我看到了Kompose,但对我不起作用。 然后我看到“在Kubernetes上编写”,发现这仅适用于企业版。
您如何将容器转移到Kubernetes? 特别是docker-compose文件。 我该如何解决Kompose错误? 如您在本文下面看到的那样,Kompose拒绝了我的项目。

WARN Volume mount on the host "/home/fatih/Desktop/Django-DevOps-personal-website/pgdata" isn't supported - ignoring path on the host 
WARN Volume mount on the host "/home/fatih/Desktop/Django-DevOps-personal-website/config/nginx" isn't supported - ignoring path on the host 
WARN Volume mount on the host "/home/fatih/Desktop/Django-DevOps-personal-website/fatihkocnet" isn't supported - ignoring path on the host 
INFO Kubernetes file "db-service.yaml" created    
INFO Kubernetes file "nginx-ssl-proxy-service.yaml" created 
INFO Kubernetes file "web-service.yaml" created   
INFO Kubernetes file "db-deployment.yaml" created 
INFO Kubernetes file "db-claim0-persistentvolumeclaim.yaml" created 
INFO Kubernetes file "nginx-ssl-proxy-deployment.yaml" created 
INFO Kubernetes file "nginx-ssl-proxy-claim0-persistentvolumeclaim.yaml" created 
INFO Kubernetes file "nginx-ssl-proxy-claim1-persistentvolumeclaim.yaml" created 
INFO Kubernetes file "web-deployment.yaml" created 
INFO Kubernetes file "web-claim0-persistentvolumeclaim.yaml" created 

您可以从这里查看我的源代码

您有几种选择。 来自Kompose的警告是因为它当前不支持在主机上存储数据,因此您可以解决这个问题。 您可以使用emptyDir作为临时存储的一种方式,也可以查看配置hostPath但这取决于您的目标环境。 如果您打算部署到云提供商,那么最好查看其支持的存储的选项。

如果您不决定切换到Nginx-ingress,另一种选择是创建一个使用正式头盔图表头盔图表,用于Postgres,也可能用于Nginx。 如果您希望长期使用kubernetes,并且想要一个能够利用kubernetes功能并且可以部署在不同类型kubernetes集群上的部署描述符,那么这可能很有意义。

如果您只是想拥有一种在单台机器上运行代码的快速方法,那么正如@ johnharris85所指出的那样, 在Kubernetes上进行撰写对您来说很有意义。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM