Weave GitOps

380 阅读1分钟

Weave GitOps是一个免费和开源的持续交付产品,可以在任何Kubernetes中运行应用程序。 它是由Weaveworks捐赠给CNCF,可用于Flux。

前提条件:cluster bootstrapped Flux version >= 0.32.0(可以参考:juejin.cn/post/716143…

安装 Weave GitOps

  • 安装Weave GitOps CLI
install weaveworks/tap/gitops
  • 生成HelmRepository and HelmRelease
PASSWORD="<your password>"
gitops create dashboard ww-gitops \  
--password=$PASSWORD \  
--export > weave-gitops-dashboard.yaml
  • 提交部署

将weave-gitops-dashboard.yaml 提交到flux git repository目录下

git add weave-gitops-dashboard.yaml && git commit -m "Add Weave GitOps Dashboard" 
git push
  • 检查
kubectl get pods -n flux-system

NAME                                         READY   STATUS    RESTARTS   AGE
helm-controller-d5459fbf9-twpfr              1/1     Running   0          7d23h
kustomize-controller-5b6bdf6867-wz488        1/1     Running   0          7d23h
notification-controller-9f5cc5d9f-8vh98      1/1     Running   0          7d23h
sealed-secrets-controller-779d989478-48zpw   1/1     Running   0          20d
source-controller-6dcfb9cb4-gkxxx            1/1     Running   0          7d23h
ww-gitops-weave-gitops-7cfd6c9666-glkmz      1/1     Running   0          8d
  • 登录
  1. 映射到本地端口
kubectl port-forward svc/ww-gitops-weave-gitops -n flux-system 9001:9001
  1. 增加Ingress转发
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ww-gitops-weave-gitops
  namespace: flux-system
spec:
  ingressClassName: nginx
  rules:
  - host: <host-name>
    http:
      paths:
      - backend:
          service:
            name: ww-gitops-weave-gitops
            port:
              number: 9001
        path: /
        pathType: Prefix

image.png