部署 Argo Rollouts v1.6.3

发布时间 2023-12-11 19:00:16作者: 小吉猫

创建 ns argo-rollouts

# kubectl create namespace argo-rollouts
namespace/argo-rollouts created

安装 argo-rollouts

# kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
customresourcedefinition.apiextensions.k8s.io/analysisruns.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/analysistemplates.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/clusteranalysistemplates.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/experiments.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/rollouts.argoproj.io created
serviceaccount/argo-rollouts created
clusterrole.rbac.authorization.k8s.io/argo-rollouts created
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-admin created
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-edit created
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-view created
clusterrolebinding.rbac.authorization.k8s.io/argo-rollouts created
configmap/argo-rollouts-config created
secret/argo-rollouts-notification-secret created
service/argo-rollouts-metrics created
deployment.apps/argo-rollouts created

安装 dashboard

# kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/download/v1.6.3/dashboard-install.yaml
serviceaccount/argo-rollouts-dashboard created
clusterrole.rbac.authorization.k8s.io/argo-rollouts-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/argo-rollouts-dashboard created
service/argo-rollouts-dashboard created
deployment.apps/argo-rollouts-dashboard created

安装 Argo Rollouts Kubectl 插件

下载 Argo Rollouts Kubectl 插件

# wget https://github.com/argoproj/argo-rollouts/releases/download/v1.6.3/kubectl-argo-rollouts-linux-amd64

添加执行权限

# chmod +x ./kubectl-argo-rollouts-linux-amd64

添加环境变量

# mv kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts

查看版本信息

# kubectl argo rollouts version
kubectl-argo-rollouts: v1.6.3+c7f7d1e
  BuildDate: 2023-12-05T13:38:04Z
  GitCommit: c7f7d1eaa9dfab501c768e7869ad7d2d0338c489
  GitTreeState: clean
  GoVersion: go1.20.11
  Compiler: gc
  Platform: linux/amd64

查看 argo rollouts 资源

dashboard以单独pod运行。

查看 pod

# kubectl get pods -n argo-rollouts
NAME                                       READY   STATUS    RESTARTS   AGE
argo-rollouts-65f649765f-4bslc             1/1     Running   0          9m42s
argo-rollouts-dashboard-6cd849f7bf-2dj5b   1/1     Running   0          97s

查看 svc

# kubectl get svc -n argo-rollouts
NAME                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
argo-rollouts-dashboard   ClusterIP   10.100.105.201   <none>        3100/TCP   118s
argo-rollouts-metrics     ClusterIP   10.100.116.36    <none>        8090/TCP   10m

查看 CRD

# kubectl api-resources |grep argo
analysisruns                      ar                                              argoproj.io/v1alpha1                           true         AnalysisRun
analysistemplates                 at                                              argoproj.io/v1alpha1                           true         AnalysisTemplate
applications                      app,apps                                        argoproj.io/v1alpha1                           true         Application
applicationsets                   appset,appsets                                  argoproj.io/v1alpha1                           true         ApplicationSet
appprojects                       appproj,appprojs                                argoproj.io/v1alpha1                           true         AppProject
clusteranalysistemplates          cat                                             argoproj.io/v1alpha1                           false        ClusterAnalysisTemplate
experiments                       exp                                             argoproj.io/v1alpha1                           true         Experiment
rollouts                          ro                                              argoproj.io/v1alpha1                           true         Rollout

暴露 dashboard

argo-rollouts-dashboard-virtualservice.yaml 

---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: argo-rollouts-dashboard
  namespace: argo-rollouts
spec:
  host: argo-rollouts-dashboard
  trafficPolicy:
    tls:
      mode: DISABLE
---
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: argo-rollouts-dashboard-gateway
  namespace: istio-system
spec:
  selector:
    app: istio-ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "argo-rollouts.wgs.com"
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: argo-rollouts-dashboard-virtualservice
  namespace: argo-rollouts
spec:
  hosts:
  - "argo-rollouts.wgs.com"
  gateways:
  - istio-system/argo-rollouts-dashboard-gateway
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: argo-rollouts-dashboard
        port:
          number: 3100
---

创建 vs

# kubectl apply -f argo-rollouts-dashboard-virtualservice.yaml
destinationrule.networking.istio.io/argo-rollouts-dashboard created
gateway.networking.istio.io/argo-rollouts-dashboard-gateway created
virtualservice.networking.istio.io/argo-rollouts-dashboard-virtualservice created

查看 vs

# kubectl get vs -n argo-rollouts
NAME                                     GATEWAYS                                           HOSTS                       AGE
argo-rollouts-dashboard-virtualservice   ["istio-system/argo-rollouts-dashboard-gateway"]   ["argo-rollouts.wgs.com"]   52s

查看 Istio svc

# kubectl get svc -n istio-system
NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)                                      AGE
istio-egressgateway     ClusterIP      10.100.156.22    <none>            80/TCP,443/TCP                               24d
istio-ingressgateway    LoadBalancer   10.100.148.114   192.168.174.249   15021:31031/TCP,80:31283/TCP,443:30741/TCP   25d
istiod                  ClusterIP      10.100.158.79    <none>            15010/TCP,15012/TCP,443/TCP,15014/TCP        25d
knative-local-gateway   ClusterIP      10.100.169.65    <none>            80/TCP                                       23d

添加hosts

# echo "192.168.174.249 argo-rollouts.wgs.com" >> hosts

访问dashboard

http://argo-rollouts.wgs.com/
返回空白页面

参考文档

https://argoproj.github.io/argo-rollouts/installation/