From 49d67e51988862b3ce695244da9f0078f7b232ad Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Wed, 1 Nov 2023 18:19:16 +0100 Subject: [PATCH] feat(split): use configuration-observability-oss, removed xService Signed-off-by: Christopher Haar --- apis/cluster/composition.yaml | 30 ++---- apis/cluster/definition.yaml | 9 +- apis/cluster/services/definition.yaml | 86 ---------------- apis/cluster/services/flux/composition.yaml | 98 ------------------- .../services/prometheus/composition.yaml | 45 --------- crossplane.yaml | 2 + examples/cluster-claim-flux.yaml | 23 ----- 7 files changed, 12 insertions(+), 281 deletions(-) delete mode 100644 apis/cluster/services/definition.yaml delete mode 100644 apis/cluster/services/flux/composition.yaml delete mode 100644 apis/cluster/services/prometheus/composition.yaml delete mode 100644 examples/cluster-claim-flux.yaml diff --git a/apis/cluster/composition.yaml b/apis/cluster/composition.yaml index f344836..84d4e71 100644 --- a/apis/cluster/composition.yaml +++ b/apis/cluster/composition.yaml @@ -66,30 +66,18 @@ spec: - fromFieldPath: spec.parameters.iam.userArn toFieldPath: spec.parameters.iam.userArn - base: - apiVersion: aws.platformref.upbound.io/v1alpha1 - kind: XServices - name: compositeClusterServices + apiVersion: observe.platform.upbound.io/v1alpha1 + kind: XOss + name: compositeObservability patches: - fromFieldPath: spec.parameters.deletionPolicy - toFieldPath: spec.deletionPolicy + toFieldPath: spec.parameters.deletionPolicy - fromFieldPath: spec.parameters.id - toFieldPath: spec.providerConfigRef.name - - fromFieldPath: spec.parameters.services.operators.flux.version - toFieldPath: spec.operators.flux.version + toFieldPath: spec.parameters.id - fromFieldPath: spec.parameters.services.operators.prometheus.version - toFieldPath: spec.operators.prometheus.version - - fromFieldPath: spec.parameters.gitops.url - toFieldPath: spec.gitops.url - - fromFieldPath: spec.parameters.gitops.path - toFieldPath: spec.gitops.path - - fromFieldPath: spec.parameters.gitops.kubeConfigSecretRef.name - toFieldPath: spec.gitops.kubeConfigSecretRef.name - - fromFieldPath: spec.parameters.gitops.kubeConfigSecretRef.namespace - toFieldPath: spec.gitops.kubeConfigSecretRef.namespace - - fromFieldPath: spec.parameters.serviceSelector - toFieldPath: spec.compositionSelector.matchLabels[type] + toFieldPath: spec.parameters.operators.prometheus.version - - name: usageXEksByXService + - name: usageXEksByXOss base: apiVersion: apiextensions.crossplane.io/v1alpha1 kind: Usage @@ -100,8 +88,8 @@ spec: resourceSelector: matchControllerRef: true by: - apiVersion: aws.platformref.upbound.io/v1alpha1 - kind: XServices + apiVersion: observe.platform.upbound.io/v1alpha1 + kind: XOss resourceSelector: matchControllerRef: true diff --git a/apis/cluster/definition.yaml b/apis/cluster/definition.yaml index ff9286b..bad569a 100644 --- a/apis/cluster/definition.yaml +++ b/apis/cluster/definition.yaml @@ -50,13 +50,6 @@ spec: enum: - basic default: basic - serviceSelector: - type: string - description: ServiceSelector employs a specific type of service architecture. - enum: - - default - - gitops - default: default deletionPolicy: description: Delete the external resources when the Claim/XR is deleted. Defaults to Delete enum: @@ -139,7 +132,7 @@ spec: version: type: string description: Prometheus operator version to run. - default: "41.4.1" + default: "52.1.0" required: - nodes - id diff --git a/apis/cluster/services/definition.yaml b/apis/cluster/services/definition.yaml deleted file mode 100644 index b3e7411..0000000 --- a/apis/cluster/services/definition.yaml +++ /dev/null @@ -1,86 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: CompositeResourceDefinition -metadata: - name: xservices.aws.platformref.upbound.io -spec: - group: aws.platformref.upbound.io - names: - kind: XServices - plural: xservices - versions: - - name: v1alpha1 - served: true - referenceable: true - schema: - openAPIV3Schema: - type: object - properties: - spec: - type: object - properties: - deletionPolicy: - description: Delete the external resources when the Claim/XR is deleted. Defaults to Delete - enum: - - Delete - - Orphan - type: string - default: Delete - gitops: - type: object - description: GitOps configure gitops system - properties: - url: - type: string - description: Url for GitOps Sync. - path: - type: string - description: path in Repo for GitOps Sync. - kubeConfigSecretRef: - type: object - description: location for kubeconfig - properties: - name: - type: string - description: Name of the secret. - namespace: - type: string - description: Namespace of the secret. - required: - - name - - namespace - required: - - url - operators: - type: object - description: Configuration for operators. - properties: - flux: - type: object - description: Configuration for the Flux GitOps operator. - properties: - version: - type: string - description: Flux operator version to run. - default: "2.9.2" - prometheus: - type: object - description: Configuration for the Prometheus operator. - properties: - version: - type: string - description: Prometheus operator version to run. - default: "41.4.1" - providerConfigRef: - type: object - description: "A reference to the ProviderConfig of the cluster that services should be deployed to." - properties: - name: - type: string - description: "Name of the Kubernetes provider configuration. - This will typically be the name of the cluster with a - five character suffix appended." - required: - - name - required: - - providerConfigRef - - deletionPolicy diff --git a/apis/cluster/services/flux/composition.yaml b/apis/cluster/services/flux/composition.yaml deleted file mode 100644 index 6a7df0f..0000000 --- a/apis/cluster/services/flux/composition.yaml +++ /dev/null @@ -1,98 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: Composition -metadata: - name: xservicesflux.aws.platformref.upbound.io - labels: - type: gitops -spec: - writeConnectionSecretsToNamespace: upbound-system - compositeTypeRef: - apiVersion: aws.platformref.upbound.io/v1alpha1 - kind: XServices - patchSets: - - name: Common - patches: - - type: FromCompositeFieldPath - fromFieldPath: metadata.labels - toFieldPath: metadata.labels - - type: FromCompositeFieldPath - fromFieldPath: metadata.annotations - toFieldPath: metadata.annotations - - type: FromCompositeFieldPath - fromFieldPath: spec.providerConfigRef.name - toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.deletionPolicy - toFieldPath: spec.deletionPolicy - resources: - - name: releaseFlux - base: - apiVersion: helm.crossplane.io/v1beta1 - kind: Release - spec: - rollbackLimit: 3 - forProvider: - namespace: flux-system - chart: - name: flux2 - url: https://github.com/fluxcd-community/helm-charts/releases/download/flux2-2.9.2/flux2-2.9.2.tgz - version: 2.9.2 - values: - imageAutomationController: - create: false - imageReflectionController: - create: false - patches: - - type: PatchSet - patchSetName: Common - - fromFieldPath: spec.operators.flux.version - toFieldPath: spec.forProvider.chart.version - - type: CombineFromComposite - combine: - variables: - - fromFieldPath: spec.operators.flux.version - - fromFieldPath: spec.operators.flux.version - strategy: string - string: - fmt: https://github.com/fluxcd-community/helm-charts/releases/download/flux2-%s/flux2-%s.tgz - toFieldPath: spec.forProvider.chart.url - - name: syncFlux - base: - apiVersion: helm.crossplane.io/v1beta1 - kind: Release - spec: - rollbackLimit: 3 - forProvider: - namespace: flux-system - chart: - name: flux2-sync - repository: https://fluxcd-community.github.io/helm-charts - version: "1.6.2" - values: - gitRepository: - spec: - timeout: 20s - interval: 10m0s - gitImplementation: go-git - ref: - branch: main - kustomization: - spec: - interval: 10m - sourceRef: - kind: GitRepository - patches: - - type: PatchSet - patchSetName: Common - - fromFieldPath: spec.providerConfigRef.name - toFieldPath: metadata.annotations[crossplane.io/external-name] - - fromFieldPath: spec.gitops.url - toFieldPath: spec.forProvider.values.gitRepository.spec.url - - fromFieldPath: spec.providerConfigRef.name - toFieldPath: spec.forProvider.values.kustomization.spec.path - transforms: - - type: string - string: - fmt: "./infrastructure/%s" - - fromFieldPath: spec.gitops.path - toFieldPath: spec.forProvider.values.kustomization.spec.path diff --git a/apis/cluster/services/prometheus/composition.yaml b/apis/cluster/services/prometheus/composition.yaml deleted file mode 100644 index 739ef24..0000000 --- a/apis/cluster/services/prometheus/composition.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: apiextensions.crossplane.io/v1 -kind: Composition -metadata: - name: xservices.aws.platformref.upbound.io - labels: - type: default -spec: - writeConnectionSecretsToNamespace: upbound-system - compositeTypeRef: - apiVersion: aws.platformref.upbound.io/v1alpha1 - kind: XServices - patchSets: - - name: Common - patches: - - type: FromCompositeFieldPath - fromFieldPath: metadata.labels - toFieldPath: metadata.labels - - type: FromCompositeFieldPath - fromFieldPath: metadata.annotations - toFieldPath: metadata.annotations - - type: FromCompositeFieldPath - fromFieldPath: spec.providerConfigRef.name - toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.deletionPolicy - toFieldPath: spec.deletionPolicy - resources: - - name: releasePrometheus - base: - apiVersion: helm.crossplane.io/v1beta1 - kind: Release - spec: - rollbackLimit: 3 - forProvider: - namespace: operators - chart: - name: kube-prometheus-stack - repository: https://prometheus-community.github.io/helm-charts - version: "41.4.1" - values: {} - patches: - - type: PatchSet - patchSetName: Common - - fromFieldPath: spec.operators.prometheus.version - toFieldPath: spec.forProvider.chart.version diff --git a/crossplane.yaml b/crossplane.yaml index 3e1832b..9330652 100644 --- a/crossplane.yaml +++ b/crossplane.yaml @@ -46,3 +46,5 @@ spec: version: ">=v0.1.0" - configuration: xpkg.upbound.io/upbound/configuration-app version: ">=v0.1.0" + - configuration: xpkg.upbound.io/upbound/configuration-observability-oss + version: ">=v0.1.0" diff --git a/examples/cluster-claim-flux.yaml b/examples/cluster-claim-flux.yaml deleted file mode 100644 index be10eac..0000000 --- a/examples/cluster-claim-flux.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: aws.platformref.upbound.io/v1alpha1 -kind: Cluster -metadata: - name: platform-ref-aws-gitops - namespace: default -spec: - compositeDeletePolicy: Foreground - parameters: - id: platform-ref-aws-gitops - region: us-west-2 - version: "1.27" - serviceSelector: gitops - iam: - # replace with your custom arn like: - # roleArn: arn:aws:iam::123456789:role/AWSReservedSSO_AdministratorAccess_d703c73ed340fde7 - roleArn: ${data.aws_eks_iam_default_admin} - gitops: - url: https://github.com/upbound/platform-ref-aws/ - nodes: - count: 3 - instanceType: t3.small - writeConnectionSecretToRef: - name: platform-ref-aws-gitops-kubeconfig