Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the kind bash script to install OOTB certificate manager and argocd #268

Open
cmoulliard opened this issue Aug 5, 2022 · 1 comment
Labels
enhancement New feature or request module::kind

Comments

@cmoulliard
Copy link
Member

Proposition

Extend the kind bash script to install OOTB certificate manager and argocd using helm or kubectl apply and echo as message the hostname to access the argocd server and password to be used.

Remark: If you plan to use argocd client, then it must be installed brew install argocd

Example

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.yaml

cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: selfsigned
spec:
  selfSigned: {}
EOF

HOST=192.168.1.90
kubectl create namespace argocd && kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    cert-manager.io/cluster-issuer: selfsigned
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  ingressClassName: nginx
  rules:
  - host: argocd.$HOST.sslip.io
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              name: https
  tls:
  - secretName: https-cert
    hosts:
    - argocd.$HOST.sslip.io     
EOF

PASSWORD=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
echo $PASSWORD
argocd login argocd.$HOST.sslip.io --username admin --password $PASSWORD --insecure

To test it

argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default --grpc-web
argocd app sync guestbook --grpc-web
argocd app get guestbook --grpc-web
@cmoulliard cmoulliard added the enhancement New feature or request label Aug 5, 2022
@cmoulliard
Copy link
Member Author

Small update about instructions to be used and fully tested on kind+ingress

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.1/cert-manager.yaml
cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: selfsigned
spec:
  selfSigned: {}
EOF

helm repo add argo https://argoproj.github.io/argo-helm

#helm search repo argo    
helm uninstall argocd -n argocd

cat <<EOF > values.yml
server:
  ingress:
    enabled: true
    annotations:
      cert-manager.io/cluster-issuer: selfsigned
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/ssl-passthrough: "true"
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    ingressClassName: "nginx"
    hosts:
      - argocd-ui.127.0.0.1.nip.io
    tls:
      - secretName: https-cert
        hosts:
        - argocd-ui.127.0.0.1.nip.io
    https: true
EOF

helm install argocd argo/argo-cd -n argocd --create-namespace=true -f values.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module::kind
Projects
None yet
Development

No branches or pull requests

2 participants