{"id":24637951,"url":"https://github.com/upbound/platform-ref-multi-k8s","last_synced_at":"2025-04-07T11:01:21.705Z","repository":{"id":44651060,"uuid":"313212826","full_name":"upbound/platform-ref-multi-k8s","owner":"upbound","description":"Upbound's reference platform for multi-cloud Kubernetes with Crossplane ","archived":false,"fork":false,"pushed_at":"2025-03-22T22:12:07.000Z","size":135,"stargazers_count":65,"open_issues_count":9,"forks_count":35,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-03-31T10:01:32.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upbound.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-16T06:41:43.000Z","updated_at":"2024-07-12T05:36:44.000Z","dependencies_parsed_at":"2024-02-16T17:26:06.965Z","dependency_job_id":"e90b37df-3ded-4355-ae89-de580544ae92","html_url":"https://github.com/upbound/platform-ref-multi-k8s","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Fplatform-ref-multi-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Fplatform-ref-multi-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Fplatform-ref-multi-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upbound%2Fplatform-ref-multi-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upbound","download_url":"https://codeload.github.com/upbound/platform-ref-multi-k8s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640459,"owners_count":20971556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T10:12:36.903Z","updated_at":"2025-04-07T11:01:21.670Z","avatar_url":"https://github.com/upbound.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-cloud Kubernetes Reference Platform\n\nThis repository contains a reference Multi-cloud Kubernetes Platform\nConfiguration for [Crossplane](https://crossplane.io). It's a great\nstarting point for building internal cloud platforms with AWS and\noffering a self-service API to your internal development teams.\n\nThis platform offers APIs for setting up fully configured Kubernetes\nclusters across multiple cloud providers, such as AWS, GCP, and Azure.\nYour app teams can use these platform APIs to self-service provision\ntheir own Kubernetes clusters on demand when they need them, all while\nensuring the configuration and policy guardrails that you specified are\nalso applied.\n\n## Overview\n\nThis reference platform outlines a specialized API for generating an Cluster\n([XCluster](apis/definition.yaml)) that incorporates XRs from the specified configurations:\n\n* [upbound-configuration-aws-eks](https://github.com/upbound/configuration-aws-eks)\n* [upbound-configuration-aws-network](https://github.com/upbound/configuration-aws-network)\n* [upbound-configuration-gcp-gke](https://github.com/upbound/configuration-gcp-gke)\n* [upbound-configuration-gcp-network](https://github.com/upbound/configuration-gcp-network)\n* [upbound-configuration-azure-aks](https://github.com/upbound/configuration-azure-aks)\n* [upbound-configuration-azure-network](https://github.com/upbound/configuration-azure-network)\n* [upbound-configuration-gitops-flux](https://github.com/upbound/configuration-gitops-flux)\n* [upbound-configuration-observability-oss](https://github.com/upbound/configuration-observability-oss)\n\n```mermaid\ngraph LR;\n    MyApp(my-cluster)---MyCluster(XRC: my-cluster);\n    MyCluster---XRD1(XRD: XCluster);\n\t\tsubgraph Configuration:upbound/platform-ref-multi-k8s;\n\t    XRD1---Composition(XEKS*, XAKS*, XGCP*, XNetwork, XFlux, XOss);\n\t\tend\n\t\tsubgraph Provider:upbound/provider-aws\n\t    Composition---aws1.MRs(MRs: IAM Role, VPC, Subnet);\n\t    Composition---aws2.MRs(MRs: EKS Cluster, ClusterAuth, NodeGroup);\n\t\tend\n\t\tsubgraph Provider:upbound/provider-azure\n\t    Composition---azure1.MRs(MRs: ResourceGroup, Subnet, VirtualNetwork);\n\t    Composition---azure2.MRs(MRs: KubernetesCluster);\n\t\tend\n\t\tsubgraph Provider:upbound/provider-gcp\n\t    Composition---gcp1.MRs(MRs: ProjectIAMMember, ServiceAccountKey);\n\t    Composition---gcp2.MRs(MRs: Cluster, NodePool);\n\t\tend\n\nstyle MyApp color:#000,fill:#e6e6e6,stroke:#000,stroke-width:2px\nstyle MyCluster color:#000,fill:#D68A82,stroke:#000,stroke-width:2px\nstyle Provider:upbound/provider-aws fill:#81CABB,opacity:0.3\nstyle Provider:upbound/provider-azure fill:#81CABB,opacity:0.3\nstyle Provider:upbound/provider-gcp fill:#81CABB,opacity:0.3\nstyle XRD1 color:#000,fill:#f1d16d,stroke:#000,stroke-width:2px,stroke-dasharray: 5 5\nstyle Composition color:#000,fill:#f1d16d,stroke:#000,stroke-width:2px\nstyle aws1.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\nstyle aws2.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\nstyle azure1.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\nstyle azure2.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\nstyle gcp1.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\nstyle gcp2.MRs color:#000,fill:#81CABB,stroke:#000,stroke-width:2px\n```\n\nLearn more about Composite Resources in the [Crossplane Docs](https://docs.crossplane.io/latest/concepts/compositions/).\n\n## Quickstart\n\n### Prerequisites\n\nBefore we can install the reference platform we should install the `up` CLI.\nThis is a utility that makes following this quickstart guide easier. Everything\ndescribed here can also be done in a declarative approach - which we highly\nrecommend for any production type use-case.\n\u003c!-- TODO enhance this guide: Getting ready for Gitops --\u003e\n\nTo install `up` run this install script:\n```console\ncurl -sL https://cli.upbound.io | sh\n```\nSee [up docs](https://docs.upbound.io/cli/) for more install options.\n\nWe need a running Crossplane control plane to install our instance. We are\nusing [Universal Crossplane (UXP)](https://github.com/upbound/universal-crossplane).\nEnsure that your kubectl context points to the correct Kubernetes cluster or\ncreate a new [kind](https://kind.sigs.k8s.io) cluster:\n\n```console\nkind create cluster\n```\n\nFinally install UXP into the `upbound-system` namespace:\n\n```console\nup uxp install\n```\n\nYou can validate the install by inspecting all installed components:\n\n```console\nkubectl get all -n upbound-system\n```\n\n### Install the Multi-cloud Kubernetes Reference Platform\n\nNow you can install this reference platform. It's packaged as a [Crossplane\nconfiguration package](https://docs.crossplane.io/latest/concepts/packages/) so there is a single command to install it:\n\n```console\nup ctp configuration install xpkg.upbound.io/upbound/platform-ref-multi-k8s:v0.1.0\n```\n\nValidate the install by inspecting the provider and configuration packages:\n```console\nkubectl get providers,providerrevision\n\nkubectl get configurations,configurationrevisions\n```\n\nCheck the [marketplace](https://marketplace.upbound.io/configurations/upbound/platform-ref-multi-k8s/) for the latest version of this platform.\n\nBefore we can use the reference platform we need to configure it with AWS, GCP and Azure\n### Configure the AWS provider\n\nExample `creds.conf` should look similar to the structure below:\n\n```console\n# Create a creds.conf file with the aws cli:\nAWS_PROFILE=default \u0026\u0026 echo -e \"[default]\\naws_access_key_id = $(aws configure get aws_access_key_id --profile $AWS_PROFILE)\\naws_secret_access_key = $(aws configure get aws_secret_access_key --profile $AWS_PROFILE)\" \u003e creds.conf\n\n# Create a K8s secret with the AWS creds:\nkubectl create secret generic aws-creds -n upbound-system --from-file=credentials=./creds.conf\n\n# Configure the AWS Provider to use the secret:\nkubectl apply -f examples/aws-default-provider.yaml\n```\n\nSee [provider-aws docs](https://marketplace.upbound.io/providers/upbound/provider-family-aws/latest/docs/configuration) for more detailed configuration options.\n\n### Configure the GCP provider\n\nCreate a JSON `gcp.json` key file containing the GCP account credentials. GCP provides documentation on [how to create a key file](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating).\n\nExample `gcp.json` key should look similar to the structure below:\n```json\n{\n  \"type\": \"service_account\",\n  \"project_id\": \"caramel-goat-354919\",\n  \"private_key_id\": \"e97e40a4a27661f12345678f4bd92139324dbf46\",\n  \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n===\\n-----END PRIVATE KEY-----\\n\",\n  \"client_email\": \"my-sa-313@caramel-goat-354919.iam.gserviceaccount.com\",\n  \"client_id\": \"103735491955093092925\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://oauth2.googleapis.com/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/my-sa-313%40caramel-goat-354919.iam.gserviceaccount.com\"\n}\n```\n\n#### Create a K8s secret with the GCP creds:\n\n```console\nkubectl create secret generic gcp-creds -n upbound-system --from-file=credentials=./gcp.json\n```\n\nEnsure that the following roles are added to your service account:\n\n* `roles/compute.networkAdmin`\n* `roles/container.admin`\n* `roles/iam.serviceAccountUser`\n* `roles/iam.securityAdmin`\n* `roles/iam.serviceAccountAdmin`\n* `roles/iam.serviceAccountKeyAdmin`\n* `roles/cloudsql.admin`\n\nIt is convenient to assign roles with `gcloud` CLI, e.g.\n\n```console\ngcloud projects add-iam-policy-binding --role=\"$ROLE\" $PROJECT_ID --member \"serviceAccount:$SA\"\n```\n\n#### Configure the GCP Provider to use the secret:\n```console\nkubectl apply -f https://raw.githubusercontent.com/upbound/platform-ref-gcp/main/examples/gcp-default-provider.yaml\n```\n\nSee [provider-gcp docs](https://marketplace.upbound.io/providers/upbound/provider-family-gcp/latest/docs/configuration) for more detailed configuration options.\n\n### Configure the Azure provider\n\nExample `azure.json` should look similar to the structure below:\n\n```console\n# Create a azure.json file with the azure cli:\n# Replace \u003cSubscription ID\u003e with your subscription ID.\naz ad sp create-for-rbac --sdk-auth --role Owner --scopes /subscriptions/\u003cSubscription ID\u003e \\\n  \u003e azure.json\n\n# Create a K8s secret with the Azure creds:\nkubectl create secret generic azure-creds -n upbound-system --from-file=credentials=./azure.json\n\n# Configure the Azure Provider to use the secret:\nkubectl apply -f examples/azure-default-provider.yaml\n```\n\nSee [provider-azure docs](https://marketplace.upbound.io/providers/upbound/provider-family-azure/latest/docs/configuration) for more detailed configuration options\n\n## Using the Multi-cloud Kubernetes Reference Platform\n\n🎉 Congratulations. You have just installed your first Crossplane-powered\nplatform!\n\nApplication developers can now use the platform to request resources which then\nwill be provisioned in AWS. This would usually be done by bundling a claim as part of\nthe application code. In our example here we simply create the claims directly:\n\nCreate a cluster in AWS:\n```console\nkubectl apply -f examples/aws-cluster.yaml\n```\n\nCreate a cluster in GCP:\n```console\nkubectl apply -f examples/gcp-cluster.yaml\n```\n\nCreate a cluster in Azure:\n```console\nkubectl apply -f examples/azure-cluster.yaml\n```\n\nYou can verify the status by inspecting the claims, composites and managed\nresources:\n\n```console\nkubectl get claim,composite,managed\n```\n\nTo delete the provisioned resources you would simply delete the claims:\n\n```console\nkubectl delete -f examples/aws-cluster.yaml\nkubectl delete -f examples/gcp-cluster.yaml\nkubectl delete -f examples/azure-cluster.yaml\n```\n\nTo uninstall the provider \u0026 platform configuration:\n\n```console\nkubectl delete configuration --all\nkubectl delete providers --all\nkubectl delete functions --all\n```\n\n## Customize for your Organization\n\nSo far we have used the existing reference platform but haven't made any\nchanges. Let's change this and customize the platform by ensuring the EKS\nCluster is deployed to Frankfurt (eu-central-1) and that clusters are limited\nto 10 nodes.\n\nFor the following examples we are using `my-org` and `my-platform`:\n\n```console\nORG=my-org\nPLATFORM=my-platform\n```\n\n### Pre-Requisites\nFirst you need to create a [free Upbound account](https://accounts.upbound.io/register) to push your custom platform.\nAfterwards you can log in:\n\n```console\nup login --username=$ORG\n```\n\n### Make the changes\n\nTo make your changes clone this repository:\n\n```console\ngit clone https://github.com/upbound/platform-ref-multi-k8s.git $PLATFORM \u0026\u0026 cd $PLATFORM\n```\n\n### Build and push your platform\n\nTo share your new platform you need to build and distribute this package.\n\nTo build the package use the `up xpkg build` command:\n\n```console\nup xpkg build --name package.xpkg --package-root=package --examples-root=examples\n```\n\nAfterwards you can push it to the marketplace. Don't worry - it's private to you.\n\n```console\nTAG=v0.1.0\nup repo create ${PLATFORM}\nup xpkg push ${ORG}/${PLATFORM}:${TAG} -f package/package.xpkg\n```\n\nYou can now see your listing in the marketplace:\n```console\nopen https://marketplace.upbound.io/configurations/${ORG}/${PLATFORM}/${TAG}\n```\n\n## Using your custom platform\n\nNow to use your custom platform, you can follow the steps above. The only\ndifference is that you need to specify a package-pull-secret, as the package is\ncurrently private:\n\n```console\nup ctp pull-secret create personal-pull-secret\n```\n\n```console\nup ctp configuration install xpkg.upbound.io/${ORG}/${PLATFORM}:${TAG} --package-pull-secrets=personal-pull-secret\n```\n\nFor the alternative declarative installation approach see the [example Configuration manifest](examples/configuration.yaml). Please update to your org, platform and tag before applying.\n\n🎉 Congratulations. \nYou have just built and installed your first custom Crossplane-powered platform!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupbound%2Fplatform-ref-multi-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupbound%2Fplatform-ref-multi-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupbound%2Fplatform-ref-multi-k8s/lists"}