首页 > 其他分享 >云原生--argocd 命令行

云原生--argocd 命令行

时间:2022-10-17 10:36:57浏览次数:56  
标签:status https 命令行 myapp -- 08 argocd 2022 app

前戏

在使用命令行的时候需要先登录

# 登录要指定 ip 和端口
[root@master1 ~]# argocd login 10.6.215.30:30495
WARNING: server certificate had error: x509: cannot validate certificate for 10.6.215.30 because it doesn't contain any IP SANs. Proceed insecurely (y/n)? y
Username: admin
Password:
'admin:login' logged in successfully
Context '10.6.215.30:30495' updated

命令行

查看所有的应用

# 查看所有的应用,不需要指定 ns,查询的是所有 ns 下的
[root@master1 k8s-yaml]# argocd app list
NAME   CLUSTER                         NAMESPACE  PROJECT  STATUS     HEALTH   SYNCPOLICY  CONDITIONS  REPO                                           PATH  TARGET
app01  https://kubernetes.default.svc  demo1      default  OutOfSync  Missing  <none>      <none>      https://gitee.com/zouzou_busy/devops_test.git  app
app02  https://kubernetes.default.svc  demo2      default  OutOfSync  Missing  <none>      <none>      https://gitee.com/zouzou_busy/devops_test.git  app   HEAD
app03  https://kubernetes.default.svc  demo3      default  OutOfSync  Missing  <none>      <none>      https://gitee.com/zouzou_busy/devops_test.git  app   HEAD

查看某一个应用

# 查看某一个应用
[root@master1 k8s-yaml]# argocd app get app01
Name:               app01
Project:            default
Server:             https://kubernetes.default.svc
Namespace:          demo1 # 应用所在的 ns
URL:                https://10.6.215.30:32382/applications/app01 # 应用所在的 UI 地址
Repo:               https://gitee.com/zouzou_busy/devops_test.git # 所同步的仓库地址
Target:
Path:               app # 仓库里的路径
SyncWindow:         Sync Allowed
Sync Policy:        <none> # 同步的策略
Sync Status:        OutOfSync from  (d7306f4) # 同步的状态
Health Status:      Missing # 健康状态

GROUP  KIND        NAMESPACE  NAME   STATUS     HEALTH   HOOK  MESSAGE
       Service     demo1      myapp  OutOfSync  Missing # 应用的状态
apps   Deployment  demo1      myapp  OutOfSync  Missing

同步某一个应用

# 同步 app01 的应用
[root@master1 k8s-yaml]# argocd app sync app01
TIMESTAMP                  GROUP        KIND   NAMESPACE                  NAME    STATUS    HEALTH        HOOK  MESSAGE
2022-08-18T21:40:18+08:00            Service       demo1                 myapp  OutOfSync  Missing
2022-08-18T21:40:18+08:00   apps  Deployment       demo1                 myapp  OutOfSync  Missing
2022-08-18T21:40:18+08:00            Service       demo1                 myapp    Synced  Healthy
2022-08-18T21:40:19+08:00   apps  Deployment       demo1                 myapp  OutOfSync  Missing              deployment.apps/myapp created
2022-08-18T21:40:19+08:00            Service       demo1                 myapp    Synced   Healthy              service/myapp created
2022-08-18T21:40:19+08:00   apps  Deployment       demo1                 myapp    Synced  Progressing              deployment.apps/myapp created

Name:               app01
Project:            default
Server:             https://kubernetes.default.svc
Namespace:          demo1
URL:                https://10.6.215.30:32382/applications/app01
Repo:               https://gitee.com/zouzou_busy/devops_test.git
Target:
Path:               app
SyncWindow:         Sync Allowed
Sync Policy:        <none>
Sync Status:        Synced to  (d7306f4)
Health Status:      Progressing

Operation:          Sync
Sync Revision:      d7306f4c729378979e1972a2cf857a9847ba0b8e
Phase:              Succeeded
Start:              2022-08-18 21:40:18 +0800 CST
Finished:           2022-08-18 21:40:19 +0800 CST
Duration:           1s
Message:            successfully synced (all tasks run)

GROUP  KIND        NAMESPACE  NAME   STATUS  HEALTH       HOOK  MESSAGE
       Service     demo1      myapp  Synced  Healthy            service/myapp created
apps   Deployment  demo1      myapp  Synced  Progressing        deployment.apps/myapp created

查看某个应用的 yaml 清单

# 查看某个应用的 yaml 清单
[root@master1 ~]# argocd app get app02 -o yaml
metadata:
  creationTimestamp: "2022-08-18T13:06:31Z"
  generation: 323
  managedFields:
  - apiVersion: argoproj.io/v1alpha1
    fieldsType: FieldsV1
    fieldsV1:
      f:spec:
        .: {}
        f:destination:
          .: {}
          f:namespace: {}
          f:server: {}
        f:project: {}
        f:source:
          .: {}
          f:path: {}
          f:repoURL: {}
          f:targetRevision: {}
        f:syncPolicy:
          .: {}
          f:syncOptions: {}
      f:status:
        .: {}
        f:health: {}
        f:summary: {}
        f:sync:
          .: {}
          f:comparedTo:
            .: {}
            f:destination: {}
            f:source: {}
    manager: Go-http-client
    operation: Update
    time: "2022-08-18T15:10:29Z"
  - apiVersion: argoproj.io/v1alpha1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        f:health:
          f:status: {}
        f:history: {}
        f:operationState:
          .: {}
          f:finishedAt: {}
          f:message: {}
          f:operation:
            .: {}
            f:initiatedBy:
              .: {}
              f:username: {}
            f:retry: {}
            f:sync:
              .: {}
              f:revision: {}
              f:syncOptions: {}
              f:syncStrategy:
                .: {}
                f:hook: {}
          f:phase: {}
          f:startedAt: {}
          f:syncResult:
            .: {}
            f:resources: {}
            f:revision: {}
            f:source:
              .: {}
              f:path: {}
              f:repoURL: {}
              f:targetRevision: {}
        f:reconciledAt: {}
        f:resources: {}
        f:sourceType: {}
        f:summary:
          f:images: {}
        f:sync:
          f:comparedTo:
            f:destination:
              f:namespace: {}
              f:server: {}
            f:source:
              f:path: {}
              f:repoURL: {}
              f:targetRevision: {}
          f:revision: {}
          f:status: {}
    manager: argocd-application-controller
    operation: Update
    time: "2022-08-18T15:10:31Z"
  name: app02
  namespace: argocd
  resourceVersion: "7947672"
  uid: 6deb20f8-abf8-4a05-807c-388a22bdbb0d
spec:  # 我们定义的资源清单
  destination:
    namespace: demo2
    server: https://kubernetes.default.svc
  project: default
  source:
    path: app  # 仓库里的资源路径
    repoURL: https://gitee.com/zouzou_busy/devops_test.git  # 仓库地址
    targetRevision: HEAD
  syncPolicy:  # 同步策略
    syncOptions:
    - CreateNamespace=true  # 自动创建命名空间
status:
  health:
    status: Healthy
  history:
  - deployStartedAt: "2022-08-18T13:57:42Z"
    deployedAt: "2022-08-18T13:57:55Z"
    id: 0
    revision: 30f61b0cbc32d1dfc9992893a2f94c7ad21f0d9e
    source:
      path: app
      repoURL: https://gitee.com/zouzou_busy/devops_test.git
      targetRevision: HEAD
  - deployStartedAt: "2022-08-18T14:21:22Z"
    deployedAt: "2022-08-18T14:21:23Z"
    id: 1
    revision: 64f304bd426b0d6e23eb7850901418d453a31257
    source:
      path: app
      repoURL: https://gitee.com/zouzou_busy/devops_test.git
      targetRevision: HEAD
  - deployStartedAt: "2022-08-18T14:31:45Z"
    deployedAt: "2022-08-18T14:31:52Z"
    id: 2
    revision: 30f61b0cbc32d1dfc9992893a2f94c7ad21f0d9e
    source:
      path: app
      repoURL: https://gitee.com/zouzou_busy/devops_test.git
      targetRevision: HEAD
  - deployStartedAt: "2022-08-18T15:10:30Z"
    deployedAt: "2022-08-18T15:10:31Z"
    id: 3
    revision: 7228459e2b9afebe7c54ff3bad4216ce2ebcdcf9
    source:
      path: app
      repoURL: https://gitee.com/zouzou_busy/devops_test.git
      targetRevision: HEAD
  operationState:
    finishedAt: "2022-08-18T15:10:31Z"
    message: successfully synced (all tasks run)
    operation:
      initiatedBy:
        username: admin
      retry: {}
      sync:
        revision: 7228459e2b9afebe7c54ff3bad4216ce2ebcdcf9
        syncOptions:
        - CreateNamespace=true
        syncStrategy:
          hook: {}
    phase: Succeeded
    startedAt: "2022-08-18T15:10:30Z"
    syncResult:
      resources:
      - group: ""
        hookPhase: Running
        kind: Service
        message: service/myapp unchanged
        name: myapp
        namespace: demo2
        status: Synced
        syncPhase: Sync
        version: v1
      - group: apps
        hookPhase: Running
        kind: Deployment
        message: deployment.apps/myapp configured
        name: myapp
        namespace: demo2
        status: Synced
        syncPhase: Sync
        version: v1
      revision: 7228459e2b9afebe7c54ff3bad4216ce2ebcdcf9
      source:
        path: app
        repoURL: https://gitee.com/zouzou_busy/devops_test.git
        targetRevision: HEAD
  reconciledAt: "2022-08-19T01:58:06Z"
  resources:
  - health:
      status: Healthy
    kind: Service
    name: myapp
    namespace: demo2
    status: Synced
    version: v1
  - group: apps
    health:
      status: Healthy
    kind: Deployment
    name: myapp
    namespace: demo2
    status: Synced
    version: v1
  sourceType: Directory
  summary:
    images:
    - zouzou0214/myapp:v3
  sync:
    comparedTo:
      destination:
        namespace: demo2
        server: https://kubernetes.default.svc
      source:
        path: app
        repoURL: https://gitee.com/zouzou_busy/devops_test.git
        targetRevision: HEAD
    revision: 7228459e2b9afebe7c54ff3bad4216ce2ebcdcf9
    status: Synced

 

标签:status,https,命令行,myapp,--,08,argocd,2022,app
From: https://www.cnblogs.com/zouzou-busy/p/16600358.html

相关文章

  • NFS共享磁盘异常
    NFS共享磁盘异常故障描述数据库所挂载的nfs存储网络链路出现中断,所有挂载NFS存储节点所对应的服务均出现异常。故障原因根据哈希算法特性,若业务流量五元组一致(源地址、......
  • Xshell安装
    xshell破解版链接:https://pan.baidu.com/s/15A6gimNYPiSzROBjNBzImw提取码:xxk8 软件介绍Xshell6是由国外NetSarang公司开发的一款功能强大、并且非常出色......
  • MySql必知必会
    MySql必知必会初始化数据库创建数据库CREATEDATABASEcrashcourse;创建表#########################################MySQLCrashCourse#http://www.forta.com......
  • 多线程-线程安全前篇
    线程安全如果有多个线程在同时运行而这些线程可能会同时运行这段代码程序每次运行结果和单线程运行的结果是一样的而且其他的变量的值也和预期的是一样的就像线程安......
  • 云原生--argocd 仓库管理、集群管理
    前戏在我们之前添加应用的时候,都是在下图那里添加的,但如下图那样添加有个问题,就是我们的仓库需要认证,那是没有办法的,这时候我们就需要先将仓库设置好,在这里选择就可以了......
  • 分组根据某一字段统计另一字段的总计值/sum函数与decode函数的结合
    这里有个需要按公司分组,分别统计不同公司下的费用总计,标识1和标识2都不为1的记录费用总计,达到这样的效果要求效果companyacutal的总值  标识1,2没有1个是1的expens......
  • 多线程-线程安全-同步代码块
    线程安全问题产生的原理出现了线程安全问题卖票出现了重复的票图解 线程同步当我们使用多个线程访问同一个资源的时候且多个线程对资源有写的操作就容易出现线......
  • WPF 后台代码实现绑定
    usingSystem.ComponentModel;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;namespaceWpfApp2{///<summary>///Ma......
  • MySQL维护之如何查看执行计划
    实际上在MySQL索引原理之索引分析-池塘里洗澡的鸭子-博客园(cnblogs.com)中已经使用到查看执行计划的命令explain,也进行了各列选项的解释。本文进行补充同时介绍......
  • 多线程-线程安全-同步方法
    同步方法使用synchronized修饰的方法就叫做同步方法保证A线程执行该方法的时候其他线程只能在方法外等着格式:publicsynchronizedvoidmethod(){可能......