06/05/2025

K8s – ArgoCD Metallb ve Nginx Ingress altinda

Temel kaynak : https://devopscube.com/setup-argo-cd-using-helm/

Komutlar sirasiyla böyle :

helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm search repo argo
nano argocd_ingress.yaml
kubectl apply -f argocd_ingress.yaml
helm template argo argo/argo-cd --output-dir argocd-manifests
helm show values argo/argo-cd > values.yaml
cat values.yaml
nano values.yaml
helm install --values values.yaml argocd argo/argocd -n argocd
helm search repo argo
helm install --values values.yaml argocd argo/argo-cd -n argocd

Ingress :

apiVersion: "networking.k8s.io/v1"
kind: "Ingress"
metadata:
  name: "argocd-ingress"
  namespace: "argocd"
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/backend-protocol: 'HTTPS'
    nginx.ingress.kubernetes.io/proxy-body-size: 0m
    cert-manager.io/cluster-issuer: "letsencrypt-ionos-prod"
spec:
  ingressClassName: "nginx"
  tls:
    - hosts:
      - "argocd.buyukburc.de"
      secretName: "argocd-certificates-tls"
  rules:
    - host: "argocd.buyukburc.de"
      http:
        paths:
          - pathType: "Prefix"
            path: "/"
            backend:
              service:
                name: "argocd-server"
                port:
                  number: 443

Helm Deployment

Su kisim ilgimi cekti. Helm de deploy etmeden default degerleri values.yaml a kaydedeip editleyebiliyoruz ve sonra onu deploy edebiliyoruz.
Ve kendi clusterimda metallb kullandigimiz icin NodePort olan kisimlari LoadBalancer olarak degistirmemiz gerekiyor.
Önce standard degerleri cikarip kaydedelim

helm show values argo/argo-cd > values.yaml

Sonra editleyelim

Biz LoadBalancer yaptik.

daha sonra deployment i

helm install --values values.yaml argocd argo/argo-cd --namespace argocd

Bir kac dakika alabiliyor sonra

elease "argocd" has been upgraded. Happy Helming!
NAME: argocd
LAST DEPLOYED: Tue May  6 20:09:18 2025
NAMESPACE: argocd
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
In order to access the server UI you have the following options:

1. kubectl port-forward service/argocd-server -n argocd 8080:443

    and then open the browser on http://localhost:8080 and accept the certificate

2. enable ingress in the values file `server.ingress.enabled` and either
      - Add the annotation for ssl passthrough: https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#option-1-ssl-passthrough
      - Set the `configs.params."server.insecure"` in the values file and terminate SSL at your ingress: https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#option-2-multiple-ingress-objects-and-hosts


After reaching the UI the first time you can login with username: admin and the random password generated during the installation. You can find the password by running:

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

(You should delete the initial secret afterwards as suggested by the Getting Started Guide: https://argo-cd.readthedocs.io/en/stable/getting_started/#4-login-using-the-cli)

Daha Sonra /etc/hosts veya DNS kaydini yapip browser dan erisebiliyoruz default ilk user “admin