Git Product home page Git Product logo

custom-argocd's Introduction

Custom Argo CD

About

My custom Docker image of Argo CD to add support Sops and Helm plugins:

Argo CD is un-opinionated about how secrets are managed. There's many ways to do it and there's no one-size-fits-all solution.

Reference: https://argoproj.github.io/argo-cd/operator-manual/secret-management/

A approach sugested is create custom Docker image of Argo CD.

References:

Build and send image to Docker Hub

Install Docker following the instructions in this tutorial.

In this image, the sops command will be configured to encrypt and decrypt secrets using AWS KMS.

More informations in https://github.com/mozilla/sops#kms-aws-profiles.

Change the image version of Argo CD in custom-argocd/Dockerfile file, in from line.

Change value of the AWS_KMS_ARN variable in custom-argocd/Makefile file.

Change the value of the AWS_PROFILE variable in custom-argocd/Makefile file.

Change the custom image version of Argo CD in custom-argocd/Makefile file.

Commands to build image:

cd custom-argocd

make image
make publish

Access https://hub.docker.com/r/DOCKER_HUB_ACCOUNT/custom-argocd

Commands to run container:

cd custom-argocd

make container

More information about docker run command: https://docs.docker.com/engine/reference/run/

Use Argo CD Custom

Access Kubernetes cluster.

Change content of the AWS credentials in file custom-argocd/credentials

Search by argocd-repo-server deployment and add follow content in volumeMounts section of file custom-argocd/install.yaml:

        - mountPath: /home/argocd/.aws
          name: argocd-aws-credentials

Search by argocd-repo-server deployment and add follow content in volumes section of file custom-argocd/install.yaml:

      - name: argocd-aws-credentials
        secret:
          secretName: argocd-aws-credentials

Run the command:

cd custom-argocd

kubectl create namespace argocd

kubectl delete secret argocd-aws-credentials -n argocd

kubectl create -n argocd secret generic argocd-aws-credentials --from-file=credentials=./credentials

kubectl apply -n argocd -f install.yaml

kubectl -n argocd port-forward svc/argocd-server -n argocd 8080:443

The default login is admin and a random password will be generated. To get it, run the following command in another terminal:

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

After logging into the Argo CD, change the password at the following address: https://localhost:8080/user-info?changePassword=true

After changing the password in the web interface, you can remove the secret argocd-initial-admin-secret, which contains the initial password with the following command:

kubectl -n argocd delete secret argocd-initial-admin-secret

The Argo CD can also be managed from the command line. To do this, run the following commands to install the binary:

ARGOCD_BINARY_VERSION=v2.3.3

wget https://github.com/argoproj/argo-cd/releases/download/${ARGOCD_BINARY_VERSION}/argocd-linux-amd64 -O /tmp/argocd-linux-amd64

sudo mv /tmp/argocd-linux-amd64 /usr/bin/argocd

sudo chmod +x /usr/bin/argocd

Authenticate between the binary and the server with the following command:

argocd login localhost:8080

Deploy of testapp with Argo CD

ATTENTION!!! Tested with kind 0.12.0 and k8s 1.21.10

To deploy the application:

kubectl apply -f testapp/app-example.yaml

To remove the application:

kubectl delete -f testapp/app-example.yaml

Uninstall Argo CD

To uninstall Argo CD:

kubectl delete -n argocd -f install.yaml

custom-argocd's People

Contributors

aeciopires avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.