Marketplace
BrowsePublish
Marketplace
andrzej/natzka@v1.1
official-gke

official-gke

official-gke
andrzej/natzka@v1.1official-gke
Type

Composition

Referenced XRD

XManagedCluster

Source Codegithub.com/NatzkaLabsOpenSource/managed-kubernetes
Resources (8)

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

Kind
Group
Version

Network

compute.gcp.upbound.io
v1beta1

Subnetwork

compute.gcp.upbound.io
v1beta1

Cluster

container.gcp.upbound.io
v1beta1

NodePool

container.gcp.upbound.io
v1beta1

ProviderConfig

kubernetes.crossplane.io
v1alpha1

Object

kubernetes.crossplane.io
v1alpha1

ProviderConfig

helm.crossplane.io
v1beta1

Release

helm.crossplane.io
v1beta1
YAML
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
  name: official-gke
  creationTimestamp: null
  labels:
    cluster: gke
    crossplane.io/xrd: xmanagedclusters.compositions.io
    provider: official
spec:
  compositeTypeRef:
    apiVersion: compositions.io/v1alpha1
    kind: XManagedCluster
  patchSets:
    - name: metadata
      patches:
        - fromFieldPath: metadata.labels
    - name: region
      patches:
        - fromFieldPath: spec.parameters.region
          toFieldPath: spec.forProvider.region
          transforms:
            - type: map
              map:
                afs: asia-east1
                ape: asia-east2
                apne1: asia-northeast1
                apne2: asia-northeast3
                apne3: asia-northeast2
                aps1: asia-south1
                apse1: asia-southeast1
                apse2: australia-southeast1
                apse3: asia-southeast2
                cac: northamerica-northeast1
                euc: europe-west3
                eun: europe-north1
                eus: europe-west6
                euw1: europe-west4
                euw2: europe-west2
                euw3: europe-west1
                sae: southamerica-east1
                use1: us-east4
                use2: us-east1
                usw1: us-west2
                usw2: us-west1
    - name: location
      patches:
        - fromFieldPath: spec.parameters.region
          toFieldPath: spec.forProvider.location
          transforms:
            - type: map
              map:
                afs: asia-east1
                ape: asia-east2
                apne1: asia-northeast1
                apne2: asia-northeast3
                apne3: asia-northeast2
                aps1: asia-south1
                apse1: asia-southeast1
                apse2: australia-southeast1
                apse3: asia-southeast2
                cac: northamerica-northeast1
                euc: europe-west3
                eun: europe-north1
                eus: europe-west6
                euw1: europe-west4
                euw2: europe-west2
                euw3: europe-west1
                sae: southamerica-east1
                use1: us-east4
                use2: us-east1
                usw1: us-west2
                usw2: us-west1
  resources:
    - name: compute-net
      base:
        apiVersion: compute.gcp.upbound.io/v1beta1
        kind: Network
        spec:
          forProvider:
            autoCreateSubnetworks: false
            routingMode: REGIONAL
          providerConfigRef:
            name: gcp-uxp-provider
      patches:
        - type: PatchSet
          patchSetName: metadata
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: vnet-%s
    - name: compute-subnet
      base:
        apiVersion: compute.gcp.upbound.io/v1beta1
        kind: Subnetwork
        spec:
          forProvider:
            ipCidrRange: 172.16.0.0/16
            networkSelector:
              matchControllerRef: true
            privateIpGoogleAccess: true
            secondaryIpRange:
              - ipCidrRange: 10.200.0.0/14
                rangeName: pods
              - ipCidrRange: 10.204.0.0/16
                rangeName: services
          providerConfigRef:
            name: gcp-uxp-provider
      patches:
        - type: PatchSet
          patchSetName: metadata
        - type: PatchSet
          patchSetName: region
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: snet-%s
    - name: gkecluster
      base:
        apiVersion: container.gcp.upbound.io/v1beta1
        kind: Cluster
        spec:
          forProvider:
            addonsConfig:
              - gcpFilestoreCsiDriverConfig:
                  - enabled: true
                networkPolicyConfig:
                  - disabled: false
            enableIntraNodeVisibility: true
            initialNodeCount: 1
            ipAllocationPolicy:
              - clusterSecondaryRangeName: pods
                servicesSecondaryRangeName: services
            networkPolicy:
              - enabled: true
            networkSelector:
              matchControllerRef: true
            releaseChannel:
              - channel: UNSPECIFIED
            removeDefaultNodePool: true
            subnetworkSelector:
              matchControllerRef: true
          providerConfigRef:
            name: gcp-uxp-provider
          writeConnectionSecretToRef:
            namespace: upbound-system
      patches:
        - type: PatchSet
          patchSetName: metadata
        - type: PatchSet
          patchSetName: location
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: cluster-%s
        - fromFieldPath: spec.id
          toFieldPath: spec.forProvider.network
        - fromFieldPath: spec.id
          toFieldPath: spec.forProvider.subnetwork
        - fromFieldPath: spec.parameters.version
          toFieldPath: spec.forProvider.initialClusterVersion
        - fromFieldPath: spec.id
          toFieldPath: spec.writeConnectionSecretToRef.name
          transforms:
            - type: string
              string:
                fmt: "%s-gkecluster"
        - fromFieldPath: spec.writeConnectionSecretToRef.namespace
        - type: ToCompositeFieldPath
          fromFieldPath: metadata.name
          toFieldPath: status.clusterName
        - type: ToCompositeFieldPath
          fromFieldPath: status.conditions[0].status
          toFieldPath: status.controlPlaneStatus
        - type: ToCompositeFieldPath
          fromFieldPath: metadata.name
          toFieldPath: status.fargateProfileStatus
          transforms:
            - type: string
              string:
                fmt: NA4-%s
      connectionDetails:
        - fromConnectionSecretKey: kubeconfig
      readinessChecks:
        - type: MatchString
          fieldPath: status.conditions[0].status
          matchString: "True"
    - name: gkenode
      base:
        apiVersion: container.gcp.upbound.io/v1beta1
        kind: NodePool
        spec:
          forProvider:
            autoscaling:
              - maxNodeCount: 10
            clusterSelector:
              matchControllerRef: true
            management:
              - autoRepair: true
                autoUpgrade: false
            nodeConfig:
              - oauthScopes:
                  - https://www.googleapis.com/auth/cloud-platform
                  - https://www.googleapis.com/auth/devstorage.read_only
                  - https://www.googleapis.com/auth/logging.write
                  - https://www.googleapis.com/auth/monitoring
                  - https://www.googleapis.com/auth/compute
                shieldedInstanceConfig:
                  - enableIntegrityMonitoring: true
                    enableSecureBoot: true
          providerConfigRef:
            name: gcp-uxp-provider
      patches:
        - type: PatchSet
          patchSetName: metadata
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: ng0%s
        - fromFieldPath: spec.parameters.nodeCount
          toFieldPath: spec.forProvider.autoscaling[0].minNodeCount
        - fromFieldPath: spec.parameters.nodeCount
          toFieldPath: spec.forProvider.initialNodeCount
        - fromFieldPath: spec.parameters.nodeSize
          toFieldPath: spec.forProvider.nodeConfig[0].machineType
          transforms:
            - type: map
              map:
                large: e2-standard-16
                medium: e2-standard-4
                small: e2-standard-2
        - type: ToCompositeFieldPath
          fromFieldPath: status.conditions[0].status
          toFieldPath: status.nodePoolStatus
      readinessChecks:
        - type: MatchString
          fieldPath: status.conditions[0].status
          matchString: "True"
    - name: kubernetes
      base:
        apiVersion: kubernetes.crossplane.io/v1alpha1
        kind: ProviderConfig
        spec:
          credentials:
            secretRef:
              key: kubeconfig
            source: Secret
          identity:
            secretRef:
              key: credentials
              name: gcp-account-creds
            source: Secret
            type: GoogleApplicationCredentials
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.writeConnectionSecretToRef.namespace
          toFieldPath: spec.credentials.secretRef.namespace
        - fromFieldPath: spec.writeConnectionSecretToRef.namespace
          toFieldPath: spec.identity.secretRef.namespace
        - fromFieldPath: spec.id
          toFieldPath: spec.credentials.secretRef.name
          transforms:
            - type: string
              string:
                fmt: "%s-gkecluster"
      readinessChecks:
        - type: None
    - name: k8s-ns-xp
      base:
        apiVersion: kubernetes.crossplane.io/v1alpha1
        kind: Object
        spec:
          forProvider:
            manifest:
              apiVersion: v1
              kind: Namespace
              metadata:
                name: upbound-system
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-ns-xp"
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
    - name: helm
      base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: ProviderConfig
        spec:
          credentials:
            secretRef:
              key: kubeconfig
            source: Secret
          identity:
            secretRef:
              key: credentials
              name: gcp-account-creds
            source: Secret
            type: GoogleApplicationCredentials
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
        - fromFieldPath: spec.writeConnectionSecretToRef.namespace
          toFieldPath: spec.credentials.secretRef.namespace
        - fromFieldPath: spec.id
          toFieldPath: spec.credentials.secretRef.name
          transforms:
            - type: string
              string:
                fmt: "%s-gkecluster"
        - fromFieldPath: spec.writeConnectionSecretToRef.namespace
          toFieldPath: spec.identity.secretRef.namespace
      readinessChecks:
        - type: None
    - name: helm-uxp
      base:
        apiVersion: helm.crossplane.io/v1beta1
        kind: Release
        spec:
          forProvider:
            chart:
              name: universal-crossplane
              repository: https://charts.upbound.io/stable
              version: 1.9.1-up.2
            namespace: upbound-system
          rollbackLimit: 3
      patches:
        - fromFieldPath: spec.id
          toFieldPath: metadata.name
          transforms:
            - type: string
              string:
                fmt: "%s-uxp"
        - fromFieldPath: spec.id
          toFieldPath: spec.providerConfigRef.name
  writeConnectionSecretsToNamespace: upbound-system
Marketplace

Discover the building blocks for your internal cloud platform.

© 2022 Upbound, Inc.

SolutionsProvidersConfigurations
LearnDocumentationTry for Free
MorePrivacy PolicyTerms & Conditions
Marketplace

© 2022 Upbound, Inc.

Marketplace

Discover the building blocksfor your internal cloud platform.