git - 在 Kubernetes 上自动部署
问题描述
我在 Github 上有一个分支,我确实从中提取请求并添加一些功能并创建一个新功能分支。所以我有主分支,功能 1 分支,功能 2 分支..等等。我想要的是自动构建它们的每个功能分支的每个图像的 docker 图像,然后将它们部署在 kubernetes 上并使用 url 公开它们的服务(kubernetes 在 AWS 上)。之后,如果我在拉取请求后批准功能分支到大师,删除其在k8s上的部署。提前致谢
解决方案
如果您使用 GitHub,您可以使用GitHub 操作来实现此目的,如果您在 GitLab 上,您也可以使用GitLab CI pipeline来实现。
For feature branch you can keep different config name, service name, deployment name.
in CI add the logic if branch name if staging
apply the feature Yaml with command
kubectl delete -f .....if branch name is feature apply the yaml with command
kubectl apply -f
这很简单,但是您可能必须使用更多详细信息更新问题。
推荐阅读
- sqlite - Sqlite通过Union by Groups加入2个表
- git - 防止 Git Interactive Rebase 打开 Atom
- ios - 有没有办法在 Swift 4 中使用 CGContext 创建没有指针的图像
- angular - 如何通过角度4中的函数在输入类型=“文件”处删除选定的文件名?
- c# - 在不使用 INotifyPropertyChanged 的情况下检测值更改
- react-native - 如何在本机反应中对齐多行文本
- java - Java 8 可选。为什么of和ofNullable?
- google-cloud-memorystore - 谷歌云内存存储和谷歌 AppEngine 标准与 python 3
- ios - 如何将发布请求发送到 Firebase 功能?
- javascript - Reactjs:如何更新 reactjs 中的投票计数