devops-toolkit/dot-gitops@v0.2.14
gitops-argo-cd-gcp

gitops-argo-cd-gcp

gitops-argo-cd-gcp
devops-toolkit/dot-gitops@v0.2.14gitops-argo-cd-gcp
Type

Composition

Referenced XRD

GitOps

Source Codegithub.com/vfarcic/devops-toolkit-crossplane/tree/master/packages/gitops
Resources (5)

The following resources are composed to implement the referenced Composite Resource Definition (XRD).

Kind
Group
Version

ProviderConfig

helm.crossplane.io
v1beta1

Release

helm.crossplane.io
v1beta1

ProviderConfig

kubernetes.crossplane.io
v1alpha1

Object

kubernetes.crossplane.io
v1alpha1

Object

kubernetes.crossplane.io
v1alpha1
YAML
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
  name: gitops-argo-cd-gcp
  creationTimestamp: null
  labels:
    provider: argo-gcp
spec:
  compositeTypeRef:
    apiVersion: devopstoolkitseries.com/v1alpha1
    kind: GitOps
  patchSets:
    - name: metadata
      patches:
        - fromFieldPath: metadata.labels
  resources:
    - name: helm
      base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: ProviderConfig
        spec:
          credentials:
            secretRef:
              key: kubeconfig
            source: Secret
          identity:
            secretRef:
              key: creds
              name: gcp-creds
              namespace: crossplane-system
            source: Secret
            type: GoogleApplicationCredentials
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.parameters.kubeConfig.secretNamespace
          toFieldPath: spec.credentials.secretRef.namespace
        - fromFieldPath: spec.parameters.kubeConfig.secretName
          toFieldPath: spec.credentials.secretRef.name
        - fromFieldPath: spec.parameters.kubeConfig.secretKey
          toFieldPath: spec.credentials.secretRef.key
      readinessChecks:
        - type: None
    - name: argocd
      base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: Release
        spec:
          forProvider:
            chart:
              name: argo-cd
              repository: https://argoproj.github.io/argo-helm
              version: 3.26.3
            namespace: argocd
            set:
              - name: server.extraArgs
                value: "{--insecure}"
              - name: controller.args.appResyncPeriod
                value: "30"
              - name: configs.secret.argocdServerAdminPassword
                value: $2a$10$m3eTlEdRen0nS86c5Zph5u/bDFQMcWZYdG3NVdiyaACCqoxLJaz16
              - name: configs.secret.argocdServerAdminPasswordMtime
                value: 2021-11-08T15:04:05Z
          rollbackLimit: 3
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-argocd"
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
    - name: kubernetes
      base:
        apiVersion: kubernetes.crossplane.io/v1alpha1
        kind: ProviderConfig
        spec:
          credentials:
            secretRef:
              key: kubeconfig
            source: Secret
          identity:
            secretRef:
              key: creds
              name: gcp-creds
              namespace: crossplane-system
            source: Secret
            type: GoogleApplicationCredentials
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.parameters.kubeConfig.secretNamespace
          toFieldPath: spec.credentials.secretRef.namespace
        - fromFieldPath: spec.parameters.kubeConfig.secretName
          toFieldPath: spec.credentials.secretRef.name
        - fromFieldPath: spec.parameters.kubeConfig.secretKey
          toFieldPath: spec.credentials.secretRef.key
      readinessChecks:
        - type: None
    - name: argocd-project
      base:
        apiVersion: kubernetes.crossplane.io/v1alpha1
        kind: Object
        spec:
          forProvider:
            manifest:
              apiVersion: argoproj.io/v1alpha1
              kind: AppProject
              metadata:
                finalizers:
                  - resources-finalizer.argocd.argoproj.io
                name: production
                namespace: argocd
              spec:
                clusterResourceWhitelist:
                  - group: "*"
                    kind: "*"
                description: Production project
                destinations:
                  - namespace: "*"
                    server: "*"
                namespaceResourceWhitelist:
                  - group: "*"
                    kind: "*"
                sourceRepos:
                  - "*"
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-argocd-project"
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
    - name: argocd-app
      base:
        apiVersion: kubernetes.crossplane.io/v1alpha1
        kind: Object
        spec:
          forProvider:
            manifest:
              apiVersion: argoproj.io/v1alpha1
              kind: Application
              metadata:
                finalizers:
                  - resources-finalizer.argocd.argoproj.io
                name: production-apps
                namespace: argocd
              spec:
                destination:
                  namespace: production
                  server: https://kubernetes.default.svc
                project: production
                source:
                  path: apps
                  targetRevision: HEAD
                syncPolicy:
                  automated:
                    allowEmpty: true
                    prune: true
                    selfHeal: true
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-argocd-app"
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
        - fromFieldPath: spec.parameters.gitOpsRepo
          toFieldPath: spec.forProvider.manifest.spec.source.repoURL
Discover the building blocks for your internal cloud platform.
© 2024 Upbound, Inc.
Solutions