我已經簽出了helm.sh當然,但乍一看整個設置似乎有點複雜(掌舵客戶端&分櫱服務器)。在我看來,我可以通過在大多數情況下擁有一個掌舵客戶端而逃脫。如何版本控制kubernetes應用程序?
這是我目前做
比方說,我有一個3個服務即組成項目。 postgres
,express
,nginx
。
我創建了一個名爲product-release
目錄如下:
product-release/
.git/
k8s/
postgres/
Deployment.yaml
Service.yaml
Secret.mustache.yaml # Needs to be rendered by the dev before use
express/
Deployment.yaml
Service.yaml
nginx/
Deployment.yaml
Service.yaml
updates/
0.1__0.2/
Job.yaml # postgres schema migration
update.sh # k8s API server scritps to patch/replace existing k8s objects, and runs the state change job
通常的混帳東西,現在可以申請。每次我做出更改時,我都會對規格文件進行更改,測試它們,編寫更新腳本以幫助從最新版本移動到當前版本,然後提交併標記它。
問題:
- 這個工作對我來說,到目前爲止,但就是這個 「正確的方式」?
- 爲什麼
helm
有分櫱機服務器?在客戶端做模板不是更簡單嗎?當然,如果你想將部署的活動與應用程序的知識(如祕密)分開,模板將不得不在服務器上發生,但爲什麼?