Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[ArgoCD] Add other Cluster rancher or k8s into ArgoCD.

Posted on August 25, 2021April 21, 2022 By nim 2 Comments on [ArgoCD] Add other Cluster rancher or k8s into ArgoCD.

Bạn đã có sẵn 1 hệ thông ArgoCD và được install trên Cluster A(k8s) nhưng nếu bạn có cluster k8s B và cluster k8s rancher C. Vậy chẳng lẽ chạy qua cluster C và B cài lại ArgoCD.
Không ý tưởng của mình là dùng ArgoCD trên cluster A và quản lý cả cluster B và C luôn.

https://argoproj.github.io/argo-cd/user-guide/commands/argocd_cluster_add/

Ở link trên sẽ chỉ các bạn add 1 cluster k8s bằng argocd cli. Argocd tham khảo context cuả kubeconfig để biết là sẽ add cluster nào vào argocd

Nhưng vấn đề nếu bạn muốn add cluster k8s thông qua kubeconfig của Rancher, nghĩ là k8s của bạn đang được quản lý bằng rancher thì sẽ có lỗi

argocd cluster add CONTEXT-RANCHER [flags]

>>>>xuất hiện lỗi.
rpc error: code = Unauthenticated desc = the server has asked for the client to provide credentials

Giờ bạn tham khảo các bài viết sau:

https://gist.github.com/janeczku/b16154194f7f03f772645303af8e9f80

ArgoCD behind Istio on Rancher

https://argoproj.github.io/argo-cd/operator-manual/troubleshooting/#cluster-credentials

Giờ là cách làm của mình

Đầu tiền bạn tạo tài khoản trên rancher nếu chưa có

tạo API hay Keys cho argocd nhé
Nhận về token nó chỉ hiển thị 1 lần thôi

lấy caí url của cluster mà bạn vựa chọn ở phần token

tạo ra file secret và apply cho namespace argocd

root@work-space-u20:~/argocd# cat secret-argocd-k8s-cluster2.yaml 
apiVersion: v1
kind: Secret
metadata:
  name: racherprod-k8s-cluster2-secret
  labels:
    argocd.argoproj.io/secret-type: cluster
  namespace: argocd
type: Opaque
stringData:
  name: rancher-k8s-cluster2
  server: https://192.168.101.34/k8s/clusters/c-f8569
  config: |
    {
      "bearerToken": "token-mm945:8s77cpjmxqllrq5b45gzmrws4knn4s9tc77bbngvbf4mm8rdvkbwnw",
      "tlsClientConfig": {
        "insecure": true
      }
    }

Nếu web rancher của mình ko có ssl xanh lè nền mình để “insecure”: true

Sau khi apply thì kiểm tra:

Deploy thử thấy ăn là ok

lên racher kiểm tra

ArgoCD, Kubernetes & Container

Post navigation

Previous Post: [issue/alpine] docker 20.10.2 -> golang:1-alpine3.14 error: make: go: Operation not permitted
Next Post: [Istio/multi cluster] Install multi-cluster Istio with mode “Primary-Remote” for Kubernetes on Google Cloud Platform.

More Related Articles

[kiali] Config authentication on Kiali. Isito-EnvoyFilter
[Kubecost] Đánh giá chi phí và hiệu quả sử dụng của hệ thống Kubernetes của bạn. Kubernetes & Container
Hướng dẫn đưa secret của Kubernetes thành biến env của pod Kubernetes
[Kustomize] Tìm hiểu về Kustomize tool cho k8s, có thể dùng cho ArgoCD. Kubernetes & Container
[Lens/Kubernetes] Install Lens to manage the workloads On Kubernetes. Kubernetes & Container
[Helm-k8s] Researching to write a unit test for your helm chart – Kubernetes Helm Chart

Comments (2) on “[ArgoCD] Add other Cluster rancher or k8s into ArgoCD.”

  1. med says:
    April 21, 2022 at 1:39 pm

    If it’s EKS type of cluster you have to run cluster add command with additional flag if you are running it on same cluster you will be managing.
    argocd cluster add –in-cluster

    Reply
    1. nim says:
      April 21, 2022 at 1:57 pm

      Thank you for proposing your opinion. it’s very helpful.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022
  • [Postgresql] Install postgresql client and trying a few command postgresql. June 20, 2022
  • [Mount/Nextcloud] How do you mount a hard disk that was used windows into Linux. June 19, 2022

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Jenkins
    • Spinnaker
  • Coding
    • Git
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2022 NimTechnology.