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
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Rancher/K8s] Install rancher on K8s by Helm 3

Posted on July 24, 2021June 18, 2024 By nim No Comments on [Rancher/K8s] Install rancher on K8s by Helm 3

Trước khi cài rancher thì bạn cần cài cert-manager.

Nếu bạn lười đọc thì gõ command này để cài:

https://cert-manager.io/docs/installation/

kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml

Vì mình cài bằng ArgoCD nên mình sẽ tạo 1 namespace trước

kubectl create ns cert-manager

Bạn còn phải vài ingress nữa nhé, mình cũng có chỉ rồi nhé

https://notes.nimtechnology.com/2021/07/04/ingress-nginx-install-ingress-nginx-tren-k8s-bang-helm/

Giờ đến cài rancher:

helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
kubectl create namespace cattle-system

Ở đây mình sẽ cho rancher tự gen SSL vì Lab của mình ko dư pod 80 tạo ssl bằng letsEncrypt

helm install rancher rancher-latest/rancher \
  --namespace cattle-system \
  --set hostname=rancher.my.org

hostname=rancher.my.org
Phần hostname khá quan trọng nếu bạn cần chú ý nhé.

Đây là phần mình deploy bằng argocd

Chúng ta thấy tự tạo ingress theo khai báo host của chúng ta.

https://rancher.com/docs/rancher/v2.x/en/installation/install-rancher-on-k8s/

Còn 1 cách nữa là bản cài rancher lên Docker rồi -> Rancher trên container sẽ gen ra 1 số command
Bạn đem command chạy trên k8s master là Rancher sẽ control cluster của bạn

Mời các bạn ghé tham bài viết sau

https://xuanthulab.net/su-dung-rancher-de-quan-ly-kubernetes-cluster.html

Lưu ý: rancher 2.6 nó ko vào trang quản lý như cũ.
bạn vào vào trang có đuôi “/g/clusters”

https://rancher.my.org/g/clusters

Rancher dễ sử dụng lắm

Contents

Toggle
  • Issues
    • Recreate if the admin user doesn’t exist.
  • Internal error occurred: failed calling webhook “rancher.cattle.io”
  • Failed to connect to peer wss in rancher pods

Issues

Update Tue, Jan 4th, 2021

Mình có cái rancher v2.5.11 thì Issuer trong helm ko run được với cert-manager v1.6.1
Bị báo lỗi: the server could not find the requested resource…

Reset Password admin rancher

bạn chỉ cần access vào pod rancher và gõ command

rancher-69595dc9c4-fw2tg:/var/lib/rancher # reset-password
W0831 07:47:24.381808     328 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
New password for default admin user (user-f88sh):
gkGKqXv5l3nencM2ZHt <<<<=== new password

Recreate if the admin user doesn’t exist.

Trong một số trường hợp khi bạn thực hiện reset pass của rancher admin thì bạn phát hiện ra là user này cũng không tồn tại.
Bạn phải create lại user admin bằng command.
https://github.com/rancher/rancher/issues/30243#issuecomment-881540176

ensure-default-admin

Internal error occurred: failed calling webhook “rancher.cattle.io”

Nếu bạn gặp lỗi:

Unable to connect HTTPS repository: Internal error occurred: failed calling webhook "rancher.cattle.io": failed to call webhook: Post "https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation?timeout=10s": context deadline exceeded

Cách fix:
https://forums.rancher.com/t/rancher-webhook-fails-due-to-not-existing-rancher-webhook-tls-secret/36211

kubectl delete -n cattle-system MutatingWebhookConfiguration rancher.cattle.io

Failed to connect to peer wss in rancher pods

nếu bạn chạy nhiều rancher pod thì bạn sẽ khả năng gặp đc lỗi này.

[ERROR] Failed to connect to peer wss://10.195.9.217/v3/connect [local ID=10.195.8.167]: websocket: bad handshake

Đại lại các pod rancher sẽ call với nhau thông qua IP của pod
Bạn có thể test bằng cách, đứng từ 1 pod để curl pod IP của con pod rancher khác với port là 80 và 443

sau mình đã cần update terraform eks module

  node_security_group_additional_rules = {
    ingress_self_all = {
      description = "Node to node all ports/protocols"
      protocol    = "-1"
      from_port   = 0
      to_port     = 0
      type        = "ingress"
      self        = true
    }

lúc này thì mình đã mở all pod từ pod đến pod

Kubernetes, Kubernetes & Container

Post navigation

Previous Post: [Remote App/windows] Hướng dẫn cài đặt remote app trên windows để build hệ thông vdi Pro.
Next Post: [VDI/Guacamole] Hướng dẫn tạo nên hệ thống VDI siêu rẻ bằng guacamole và windows.

More Related Articles

[Harbor] Cấu hình Proxy Cache <- Docker Hub trên Harbor. Harbor
[Kubernetes] Lesson8: k8s Easy – Node Kubernetes & Container
[Nextcloud] Hướng dẫn tăng dung lượng upload file trong Docker nextcloud – upload_max_filesize Kubernetes & Container
[Kubernetes] How to Protect Your K8S. Kubernetes
[Kubernetes] Gateway API – Ingress And Service Mesh Spec Replacement? Kubernetes & Container
[Longhorn/Storage] Install Longhorn on Kubernetes through helm and config Taints and Tolerations Kubernetes & Container

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

  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025
  • [tracetcp] How to perform a tracert command using a specific port. April 3, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • 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
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.