Skip to content

How to deploy several private location with ArgoCD

You may have several clusters where you need to deploy a private location. If you use ArgoCD, you can leverage ArgoCD ApplicationSet.

Prerequisites

Before you begin, ensure you have:

  • ArgoCD installed and configured on your clusters
  • An Escape API key

Create an ApplicationSet to deploy to several clusters

Now that escape-cli repo has been added, you can now create an ApplicationSet to deploy it to several clusters.

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: escape-private-location
  namespace: escape
spec:
  goTemplate: true
  goTemplateOptions: ["missingkey=error"]
  generators:
    - list:
        elements:
          - cluster: staging-cluster
            url: https://1.2.3.4
            privateLocationName: staging 
          - cluster: prod-cluster
            url: https://2.4.6.8
            privateLocationName: prod 
  template:
    metadata:
      name: '{{.cluster}}-escape'
    spec:
      project: default
      source:
        repoURL: https://escape-technologies.github.io/cli/
        chart: private-location
        targetRevision: 0.2.6
        helm:
          parameters:
            - name: ESCAPE_PRIVATE_LOCATION
              value: '{{.privateLocationName}}'
            - name: ESCAPE_API_KEY
              value: 'YOUR_API_KEY'
      destination:
        server: '{{.url}}'
        namespace: escape
      syncPolicy:
        automated:
          prune: true
          selfHeal: true

Report the file on your ArgoCD repo

  1. Add the created manifest to your ArgoCD repo
  2. Let ArgoCD sync

For more informations, you can refer to the official ArgoCD doc.