# argocd **Repository Path**: fearless11/argocd ## Basic Information - **Project Name**: argocd - **Description**: Deploy the service in Kubernetes using GitOps. - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-14 - **Last Updated**: 2025-06-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: Kubernetes ## README [toc] # argocd Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. - GitOps: user -> git -> argocd -> k8s - https://argo-cd.readthedocs.io/en/stable/ - https://github.com/argoproj/argocd-example-apps/ - https://developer.aliyun.com/article/941524 --- ## install - https://argocd.devops.gold/getting_started ```sh # version # argocd-v2.13.2 # k8s-v1.20.6 kubectl create namespace argocd kubectl -n argocd apply -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml # curl -o argocd.yaml https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml # sed -i -e 's#ghcr.io/dexidp/dex:v2.41.1#hub.abc.com/basic/dex:v2.41.1#g;s#quay.io/argoproj/argocd:v2.13.2#hub.abc.com/basic/argocd:v2.13.2#g;s#redis:7.0.15-alpine#hub.abc.com/basic/redis:7.0.15-alpine#g' argocd-v2.13.2.yaml # kubectl -n argocd apply -f argocd-v2.13.2.yaml kubectl -n argocd get all # fix: deployment.apps/argocd-repo-server # issue: gpg ... --gen-key failed exit status 2 # https://github.com/argoproj/argo-cd/issues/9809 # remove configure deployment.apps/argocd-repo-server # securityContext: # seccompProfile: # type: RuntimeDefault # kubectl -n argocd get svc argocd-server # kubectl -n argocd patch svc argocd-server -p '{"spec": {"type": "NodePort"}}' kubectl -n argocd port-forward --address=0.0.0.0 svc/argocd-server 8080:80 # webUI login # http://IP:8080 admin # password kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d # CLI change password curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/v1.8.3/argocd-linux-amd64 chmod +x /usr/local/bin/argocd argocd login IP:8080 --username admin --password kBmjcUaqKuO4x0Yo argocd account update-password --account admin --current-password kBmjcUaqKuO4x0Yo --new-password admin123456 argocd app list argocd app get argocd/kafka-ui ``` --- ## usage - http://IP:8080 - Settings - Repositories - https://gitlab.abc.com/devops/argocd.git - kubectl apply -f application/kafka-ui.yaml - kubectl get pods -A |grep kafka-ui --- ## case ### alpine ```sh kubectl apply -f application/opstool.yaml # kubectl apply -f k8s/opstool/alpine.yaml ``` ### kafka-ui - https://docs.kafka-ui.provectus.io/configuration/helm-charts/quick-start ```sh # helm repo add kafka-ui https://provectus.github.io/kafka-ui-charts # helm pull kafka-ui kafka-ui/kafka-ui kubectl apply -f application/kafka-ui.yaml # kubectl create ns opss # helm install -n ops k8s/kafka-ui -f k8s/kafka-ui/values.yaml kafka-ui # kubectl -n ops port-forward --address=0.0.0.0 svc/kafka-ui 8080:80 # http://IP:8080 kubectl get cm kafka-ui-fromvalues -o yaml # apiVersion: v1 # data: # config.yml: |- # kafka: # clusters: # - bootstrapServers: 10.1.12.26:9092 # name: test-kafka # - bootstrapServers: 10.1.12.3:9092 # name: uat-kafka kubectl edit cm kafka-ui-fromvalues sleep 5 kubectl rollout restart deployment kafka-ui ``` ### apollo - https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide ```sh # helm repo add apollo https://charts.apolloconfig.com # helm pull apollo/apollo-service --untar # helm pull apollo/apollo-portal --untar kubectl apply -f application/apollo.yaml # kubectl create ns apollo # helm install -n apollo k8s/apollo-service -f k8s/apollo-service/values.yaml apollo-service # helm install -n apollo k8s/apollo-portal -f k8s/apollo-portal/values.yaml apollo-portal ``` ### nacos - https://github.com/nacos-group/nacos-k8s/tree/master/helm - https://github.com/alibaba/nacos/blob/1.3.2/distribution/conf/nacos-mysql.sql ```sh # docker pull mirror.ccs.tencentyun.com/nacos/nacos-server:1.3.2 # docker pull mirror.ccs.tencentyun.com/nacos/nacos-peer-finder-plugin:1.1 # mysql -h 127.0.0.1 -P3306 -uroot -pMysql -e 'create database nacos_test' # mysql -h 127.0.0.1 -P3306 -uroot -pMysql -D nacos_test -e 'source /usr/local/nacos/conf/schema.sql' # mysql -h 127.0.0.1 -P3306 -uroot -pMysql -e "create user 'nacos_test'@'%' identified by 'nacos#123456';" # mysql -h 127.0.0.1 -P3306 -uroot -pMysql -e "grant all on nacos_test.* to 'nacos_test'@'%';" kubectl apply -f application/nacos.yaml kubectl -n nacos get all kubectl -n nacos port-forward --address=0.0.0.0 svc/nacos-cs 8848:8848 ``` ### ingress-nginx - https://github.com/kubernetes/ingress-nginx ```sh # helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx # helm install ingress-nginx ingress-nginx/ingress-nginx kubectl apply -f application/ingress-nginx.yaml ``` ### elk - https://www.elastic.co/guide/en/beats/filebeat/8.6/running-on-kubernetes.html ```sh # curl -L -O https://raw.githubusercontent.com/elastic/beats/8.6/deploy/kubernetes/filebeat-kubernetes.yaml # kubectl apply -f filebeat-kubernetes.yaml kubectl apply -f application/filebeat.yaml # helm repo add elastic https://helm.elastic.co # helm repo update elastic # helm pull logstash elastic/logstash kubectl apply -f application/logstash.yaml ``` ### metrics-server - https://github.com/kubernetes-sigs/metrics-server - https://cloud.tencent.com/developer/article/1645042 ```sh # kubectl top node # k8s-version < 1.8 install Heapster # k8s-version > 1.8 install metric-server # wget -nc -O metrics-server.yaml https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml # kubectl apply -f k8s/metrics-server kubectl apply -f application/metrics-server.yaml kubectl get --raw /apis/metrics.k8s.io/v1beta1 | jq kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes | jq kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/metrics-server-67d889ddff-59rgg | jq kubectl proxy --port 8001 curl http://127.0.0.1:8001/apis/metrics.k8s.io/v1beta1/namespaces/default/pods ``` ### coredns - https://github.com/coredns/coredns - https://www.cnblogs.com/noah-luo/p/13345194.html - https://cloud.tencent.com/developer/article/2353427 ```sh kubectl apply -f application/coredns.yaml # kubectl apply -f k8s/coredns dnsaddr=$(kubectl -n kube-system get svc kube-dns --no-headers | awk '{print $3}') dig kubernetes.default.svc.cluster.local @${dnsaddr} +short ping kubernetes ping kube-dns.kube-system.svc nslookup kubernetes.default.svc.cluster.local ```