[root@VM-0-13-centos deploy]# cat flux-deployment.yaml | grep git - name:git-key secretName:flux-git-deploy -name: git-keygen # file, which you will need to do if you host your own git # repo rather than using github or the like. You'll also need to # https://docs.fluxcd.io/en/latest/guides/use-private-git-host -name: git-key -name: git-keygen # Include this if you want to supply HTTP basic auth credentials for git # name: flux-git-auth # https://$(GIT_AUTHUSER):$(GIT_AUTHKEY)@github.com/user/repository.git ---git-url=git@github.com:nieweixing/smdemo.git ---git-branch=master # to those under the following relative paths in the git repository # - --git-path=subdir1,subdir2 ---git-label=flux-sync ---git-user=nieweixing ---git-email=nwx_qdlg@163.com # Include these two to enable git commit signing # - --git-gpg-key-import=/root/gpg-import # - --git-signing-key=<key id> # Include this to enable git signature verification # - --git-verify-signatures # - --git-readonly # Instruct flux where to put sync bookkeeping (default "git", meaning use a tag in the upstream git repo) # - --sync-state=git
[root@VM-0-13-centos deploy]# k create ns demo namespace/demo created [root@VM-0-13-centos deploy]# k label namespace demo istio-injection=enabled namespace/demo labeled
下面我们通过flux来进行demo服务的部署,首先将部署的yaml文件上传到smdemo的仓库中
1 2 3 4 5 6 7 8 9
[root@VM-0-13-centos ~]# fluxctl sync --k8s-fwd-ns flux Synchronizing with ssh://git@github.com/nieweixing/smdemo.git Revision of master to apply is eb8f408 Waiting for eb8f408 to be applied ... Done. [root@VM-0-13-centos ~]# kubectl get pod -n demo NAME READY STATUS RESTARTS AGE httpbin-66cdbdb6c5-78df6 2/2 Running 03m47s sleep-5b7bf56c54-5ngkp 2/2 Running 03m47s