diff --git a/apis/composition.yaml b/apis/composition.yaml index 9816d28..e185540 100644 --- a/apis/composition.yaml +++ b/apis/composition.yaml @@ -55,8 +55,17 @@ spec: fromFieldPath: spec.parameters.id toFieldPath: spec.parameters.providerConfigName - type: FromCompositeFieldPath - fromFieldPath: spec.parameters.operators - toFieldPath: spec.parameters.operators + fromFieldPath: spec.parameters.operators.certmanager + toFieldPath: spec.parameters.operators.certmanager + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.ingressnginx + toFieldPath: spec.parameters.operators.ingressnginx + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.externaldns + toFieldPath: spec.parameters.operators.externaldns + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.crossplane + toFieldPath: spec.parameters.operators.crossplane - name: spaces-core base: @@ -106,6 +115,49 @@ spec: readinessChecks: - type: None + - name: argocd + condition: | + "argocd" in observed.composite.resource.spec.parameters.operators && + observed.composite.resource.spec.parameters.operators.argocd.enabled == true + base: + apiVersion: gitops.platform.upbound.io/v1alpha1 + kind: XArgo + patches: + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.id + toFieldPath: spec.parameters.providerConfigName + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.argocd.ingressUrl + toFieldPath: spec.parameters.ingressUrl + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.argocd.git + toFieldPath: spec.parameters.source.git + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.argocd.resourceExclusions + toFieldPath: spec.parameters.resourceExclusions + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.argocd.resourceInclusions + toFieldPath: spec.parameters.resourceInclusions + + - name: usageXClusterByXArgo + condition: | + "argocd" in observed.composite.resource.spec.parameters.operators && + observed.composite.resource.spec.parameters.operators.argocd.enabled == true + base: + apiVersion: apiextensions.crossplane.io/v1alpha1 + kind: Usage + spec: + by: + apiVersion: gitops.platform.upbound.io/v1alpha1 + kind: XArgo + resourceSelector: + matchControllerRef: true + of: + apiVersion: spaces.platformref.upbound.io/v1alpha1 + kind: XCluster + resourceSelector: + matchControllerRef: true + - step: ordered-creation functionRef: name: crossplane-contrib-function-sequencer @@ -119,3 +171,9 @@ spec: - sequence: - spaces-init - spaces-core + - sequence: + - spaces-core + - argocd + - sequence: + - spaces-core + - usageXClusterByXArgo diff --git a/apis/definition.yaml b/apis/definition.yaml index 83aa364..b90ff5a 100644 --- a/apis/definition.yaml +++ b/apis/definition.yaml @@ -108,6 +108,46 @@ spec: version: "v1.14.6-up.1" providers: [] properties: + argocd: + type: object + properties: + enabled: + type: boolean + description: "Indicates if argocd is enabled." + default: false + version: + type: string + description: "Specifies the version of argocd helm-chart to use." + default: "5.51.1" + ingressUrl: + type: string + description: set ingressUrl for argocd server + resourceExclusions: + type: string + description: configure the list of exclude resources + resourceInclusions: + type: string + description: configure the list of included resources + git: + type: object + properties: + url: + description: URL specifies the Git repository URL, it can be an HTTP/S address. + pattern: ^(http|https)://.*\.git$ + type: string + path: + type: string + ref: + description: Reference specifies the Git reference to resolve and + monitor for changes. + type: object + properties: + name: + description: "Name of the reference to check out" + type: string + required: + - url + - ref certmanager: type: object default: @@ -205,7 +245,7 @@ spec: type: object description: "Defines the configuration for spaces." default: - version: "1.2.1" + version: "1.2.3" account: "" clusterType: "" dns: @@ -217,7 +257,7 @@ spec: version: type: string description: "The version of the space configuration." - default: "1.2.1" + default: "1.2.3" dns: type: object properties: diff --git a/apis/space-core/composition.yaml b/apis/space-core/composition.yaml index 4781715..0adfe15 100644 --- a/apis/space-core/composition.yaml +++ b/apis/space-core/composition.yaml @@ -35,6 +35,10 @@ spec: value: "true" - name: "features.alpha.eso.namespace" value: "external-secrets" + - name: "features.alpha.argocdPlugin.enabled" + value: "true" + - name: "features.alpha.argocdPlugin.target.secretNamespace" + value: "argocd" patches: - type: FromCompositeFieldPath fromFieldPath: spec.parameters.providerConfigName diff --git a/crossplane.yaml b/crossplane.yaml index d086e0c..3d6f4b0 100644 --- a/crossplane.yaml +++ b/crossplane.yaml @@ -30,6 +30,9 @@ spec: - configuration: xpkg.upbound.io/upbound/configuration-gcp-gke # renovate: datasource=github-releases depName=upbound/configuration-gcp-gke version: "v0.3.0" + - configuration: xpkg.upbound.io/upbound/configuration-gitops-argocd + # renovate: datasource=github-releases depName=upbound/configuration-gitops-argocd + version: "v0.6.0" - function: xpkg.upbound.io/upboundcare/function-conditional-patch-and-transform version: "v0.4.0" - function: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform diff --git a/examples/aws-host-space.yaml b/examples/aws-host-space.yaml index 093ddcd..5865f1a 100644 --- a/examples/aws-host-space.yaml +++ b/examples/aws-host-space.yaml @@ -37,6 +37,37 @@ spec: - name: provider-kubernetes package: xpkg.upbound.io/crossplane-contrib/provider-kubernetes:v0.12.1 localRbac: true + argocd: + enabled: true + ingressUrl: argocd-platform-ref-upbound-spaces.${data.route53ZoneName} + git: + url: https://github.com/upbound/platform-ref-upbound-spaces.git + path: gitops + ref: + name: HEAD + resourceExclusions: | + - kinds: + - ProviderConfigUsage + apiGroups: + - "*" + - kinds: + - "Nodes" + apiGroups: + - "*" + clusters: + - "*/controlplane-*" + resourceInclusions: | + - apiGroups: + - "*" + kinds: + - Provider + - Function + - Configuration + - CompositeResourceDefinition + - Composition + - Application + clusters: + - "*/controlplane-*" spaces: dns: spacesRouterDomain: platform-ref-upbound-spaces.${data.route53ZoneName} diff --git a/examples/azure-host-space.yaml b/examples/azure-host-space.yaml index 1e4702e..55d751f 100644 --- a/examples/azure-host-space.yaml +++ b/examples/azure-host-space.yaml @@ -22,6 +22,37 @@ spec: - name: provider-kubernetes package: xpkg.upbound.io/crossplane-contrib/provider-kubernetes:v0.12.1 localRbac: true + argocd: + enabled: true + ingressUrl: argocd-platform-ref-upbound-spaces.${data.route53ZoneName} + git: + url: https://github.com/upbound/platform-ref-upbound-spaces.git + path: gitops + ref: + name: HEAD + resourceExclusions: | + - kinds: + - ProviderConfigUsage + apiGroups: + - "*" + - kinds: + - "Nodes" + apiGroups: + - "*" + clusters: + - "*/controlplane-*" + resourceInclusions: | + - apiGroups: + - "*" + kinds: + - Provider + - Function + - Configuration + - CompositeResourceDefinition + - Composition + - Application + clusters: + - "*/controlplane-*" spaces: dns: spacesRouterDomain: platform-ref-upbound-spaces-aks.${data.route53ZoneName} diff --git a/examples/gcp-host-space.yaml b/examples/gcp-host-space.yaml index 6956f57..d048e0a 100644 --- a/examples/gcp-host-space.yaml +++ b/examples/gcp-host-space.yaml @@ -22,6 +22,37 @@ spec: - name: provider-kubernetes package: xpkg.upbound.io/crossplane-contrib/provider-kubernetes:v0.12.1 localRbac: true + argocd: + enabled: true + ingressUrl: argocd-platform-ref-upbound-spaces.${data.route53ZoneName} + git: + url: https://github.com/upbound/platform-ref-upbound-spaces.git + path: gitops + ref: + name: HEAD + resourceExclusions: | + - kinds: + - ProviderConfigUsage + apiGroups: + - "*" + - kinds: + - "Nodes" + apiGroups: + - "*" + clusters: + - "*/controlplane-*" + resourceInclusions: | + - apiGroups: + - "*" + kinds: + - Provider + - Function + - Configuration + - CompositeResourceDefinition + - Composition + - Application + clusters: + - "*/controlplane-*" spaces: dns: spacesRouterDomain: platform-ref-upbound-spaces-gke.${data.route53ZoneName} diff --git a/gitops/infrastructure.yaml b/gitops/infrastructure.yaml new file mode 100644 index 0000000..8b3be40 --- /dev/null +++ b/gitops/infrastructure.yaml @@ -0,0 +1,9 @@ +key: + components: + - name: spaces-reference-architecture + namespace: upbound-system + server: https://kubernetes.default.svc + project: default + repoUrl: https://github.com/upbound/spaces-reference-architecture.git + version: HEAD + folder: "bootstrap/"