下面我将通过 CNB 提供的 git-sync、attachments、tcloud-cmd 三个官方插件实现以上需求。 根据插件 git-sync 的说明,我们来填写同步任务所需的配置: 展开 "**": push: - stages: - name: Sync to GitHub image: tencentcom/git-sync "**": push: - stages: - name: Sync to GitHub image: tencentcom/git-sync
CRD叫website,接受git repo地址、deployment name、replicas 定义Controller行为 创建Deployment ,一个pod包含两个容器服务,nginx 和 git-sync git-sync用来同步git repo的代码 创建NodePort Service,提供对外访问能力 部署Controller服务 开始动手,定义Website CRD 以下是我的例子: type : "TCP", }, }, }, { // git sync container for fetching code Name: "git-sync ", Image: "openweb/git-sync", Env: []corev1.EnvVar{ { Name: "GIT_SYNC_REPO",
插件地址:https://cnb.cool/cnb/plugins/tencentcom/git-sync。官方文档使用方式写的很清楚了。 cnb.yml流水线,配置信息如下 main: push: - stages: - name: sync to github image: tencentcom/git-sync
d)Job 包含一个带有 Git-Sync 的 init 容器,将 Git 存储库代码克隆到容器上的工作区目录中。 Bitbucket SSH 配置 Github SSH 配置 这样,我们在 Kubernetes 上启动并运行 Operator 和 controller,再由 Operator 创建的 Job(git-sync
DAGs 659 dags_volume_subpath = 660 661 # For DAGs mounted via a volume claim (mutually exclusive with git-sync logs_volume_claim = 669 670 # For DAGs mounted via a hostPath volume (mutually exclusive with volume claim and git-sync git_password = 694 git_sync_root = /git 695 git_sync_dest = repo 696 # Mount point of the volume if git-sync /Users/wudong/work/Python/flow/dags 698 git_dags_folder_mount_point = 699 700 # To get Git-sync SSH 743 git_sync_container_repository = k8s.gcr.io/git-sync 744 git_sync_container_tag = v3.1.1 745 git_sync_init_container_name
website.Metadata.Name + "-website"; } 8:通过 模板 创建所需要的 部署: 请求创建的 deployment-template.json pod 模板如下: 创建 nginx 容器,提供服务 创建 git-sync ] }, { "image": "openweb/git-sync ", "name": "git-sync", "env": [
建议使用 git-sync 或 initContainers 替代。