简体   繁体   English

在Kubernetes上部署Pod /服务的方法

[英]Approach of deploying pods/services on Kubernetes

I know the concepts of Kubernetes. 我知道Kubernetes的概念。 I'm able to do some basic stuff als create a pod and create a service above it. 我能够做一些基本的工作,创建一个pod并在其上方创建一个服务。 I do this by using kubectl commands. 我通过使用kubectl命令来做到这一点。 When I'm searching for examples I see a log of .yaml and .json files. 当我搜索示例时,我看到.yaml和.json文件的日志。

Is it the global approach to create a .json or .yaml file which describes the setup of your pods/services (a bit like a docker-compose file)? 是创建描述您的Pod /服务设置的.json或.yaml文件的全局方法(有点像docker-compose文件)?

Maybe a strange question but for me it seems a bit weird that everyone who's using kubernetes is able to write his own .yaml-templates for their applications. 也许这是一个奇怪的问题,但对我来说,每个使用kubernetes的人都能够为自己的应用程序编写自己的.yaml模板似乎有点奇怪。

Creating pods and services, scaling pods etc can all be done from the kubectl using the appropriate commands. 创建Pod和服务,扩展Pod等都可以使用适当的命令从kubectl中完成。 It will internally create the necessary config and create the resources. 它将在内部创建必要的配置并创建资源。

This is great for trying out things, but not ideal for anything more serious. 这对于尝试事物很有用,但对于更严重的事物而言并不理想。 You want to version control, inspect and evolve your config. 您想要版本控制,检查和升级您的配置。 So it is better to start with a yaml or json config for what you want to create, and use that with kubectl. 因此,最好从yaml或json配置开始创建要创建的内容,然后将其与kubectl一起使用。

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

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