edp-argocd-operator

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

README

codecov

EDP Argo CD Operator

❗ Please refer to EDP documentation to get the notion of the main concepts and guidelines.

Get acquainted with the EDP ArgoCD Operator and the installation process as well as the local development, and architecture scheme.

Overview

EDP Argo CD Operator is an EDP operator that is responsible for managing ArgoCD EDP Tenants. See below diagram for details:

  • Argo CD is deployed in separate argocd namespace
  • Argo CD uses cluster-admin role for managing cluster resources
  • control-plane Application is created using AppsOfApps approach and its code is managed by control-plane members
  • control-plane is used to onboard new Argo CD Tenants (AppProjects)
  • control-plane admin provides JWT Token for each EDP Tenant
  • EDP Tenant deploys edp-argocd-operator in its EDP namespace edpTenant and uses JWT Token provided by control-plane admin
  • EDP Tenant Member manages Argo CD Repositories and Argo CD Applications using kind: Secret and kind: ArgoApplication in edpTenant namespace

edpTenant

Deployment example

Repository:

apiVersion: v1
kind: Secret
metadata:
  name: demo
  labels:
  # must be type of repository
    argocd.edp.epam.com/secret-type: repository
stringData:
  type: git
  url: ssh://argocd@gerrit.edp-delivery-sk-delivery-dev:30007/demo.git
  project: team-foo
#  Use insecure to work with privately hosted Git services over SSH.
#  If true, it is the same as use --insecure-skip-server-verification.
#  Optional, default - "false".
#  See: https://argo-cd.readthedocs.io/en/release-1.8/user-guide/private-repositories/#unknown-ssh-hosts
  insecure: "true"
  sshPrivateKey: |
    -----BEGIN OPENSSH PRIVATE KEY-----
    YOUR_PRIVATE_SSH_KEY
    -----END OPENSSH PRIVATE KEY-----

EDP Argo CD Application has the same specification as native Argo CD one

apiVersion: v1.edp.epam.com/v1alpha1
kind: ArgoApplication
metadata:
  name: demo
spec:
  project: team-foo
  destination:
    namespace: team-foo-demo
    server: https://kubernetes.default.svc
  source:
    helm:
      parameters:
        - name: image.tag
          value: master-0.1.0-1
        - name: image.repository
          value: image-repo
    path: deploy-templates
    repoURL: ssh://argocd@gerrit.edp-delivery-sk-delivery-dev:30007/demo.git
    targetRevision: master
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
    automated:
      selfHeal: true
      prune: true

example

Prerequisites

  1. Linux machine or Windows Subsystem for Linux instance with Helm 3 installed
  2. Admin access to the EDP Namespace
  3. Access to Argo CD (and JWT Token)
  4. EDP project/namespace is deployed by following the Install EDP instruction

Installation

In order to install the Operator, follow the steps below:

  1. To add the Helm EPAMEDP Charts for local client, run "helm repo add":

    helm repo add epmdedp https://epam.github.io/edp-helm-charts/stable
    
  2. Choose available Helm chart version:

    helm search repo epmdedp/edp-argocd-operator ---devel
    
    NAME                          CHART VERSION   APP VERSION       DESCRIPTION
    epmdedp/edp-argocd-operator   0.1.0  	      0.1.0             A Helm chart for EDP Argo CD Operator
    

    NOTE: It is highly recommended to use the latest released version.

  3. Deploy operator:

    Chart parameters available in deploy-templates/README.md:

  4. Install operator in the <edp_cicd_project> namespace with the helm command; find below the installation command example:

    helm install edp-argocd-operator epamedp/edp-argocd-operator \
      --version <chart_version> --namespace <edp_cicd_project>
    
  5. Check the <edp_cicd_project> namespace that should contain operator deployment with your operator in a running status.

Local Development

In order to develop the operator, first set up a local environment. For details, please refer to the Developer Guide page.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1 v1alpha1 API group +kubebuilder:object:generate=true +groupName=v1.edp.epam.com
Package v1alpha1 contains API Schema definitions for the v1 v1alpha1 API group +kubebuilder:object:generate=true +groupName=v1.edp.epam.com
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL