{"id":13687270,"url":"https://github.com/lreimer/mastering-gitops","last_synced_at":"2025-10-28T01:18:05.186Z","repository":{"id":41383511,"uuid":"477904058","full_name":"lreimer/mastering-gitops","owner":"lreimer","description":"Demo repository for Crossplane talk at Mastering GitOps conference","archived":false,"fork":false,"pushed_at":"2022-07-06T20:03:40.000Z","size":81,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T13:01:46.583Z","etag":null,"topics":["aws","conference","crossplane","crossplane-provider","demos","fluxcd","gcp","gitops","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lreimer.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}},"created_at":"2022-04-04T23:09:54.000Z","updated_at":"2025-01-13T00:06:16.000Z","dependencies_parsed_at":"2022-08-25T13:30:17.796Z","dependency_job_id":null,"html_url":"https://github.com/lreimer/mastering-gitops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lreimer/mastering-gitops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fmastering-gitops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fmastering-gitops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fmastering-gitops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fmastering-gitops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lreimer","download_url":"https://codeload.github.com/lreimer/mastering-gitops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lreimer%2Fmastering-gitops/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264365598,"owners_count":23596864,"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":["aws","conference","crossplane","crossplane-provider","demos","fluxcd","gcp","gitops","kubernetes"],"created_at":"2024-08-02T15:00:51.317Z","updated_at":"2025-10-28T01:18:05.073Z","avatar_url":"https://github.com/lreimer.png","language":"Makefile","funding_links":[],"categories":["aws"],"sub_categories":[],"readme":"# kubectl apply -f cloud-infrastructure.yaml with Crossplane\n\nDemo repository for my Crossplane conference talk.\n\n## Prerequisites\n\nYou need to have the following tools installed locally to be able to complete all steps:\n- [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)\n- [eksctl](https://eksctl.io/)\n- [gcloud CLI](https://cloud.google.com/sdk/gcloud)\n- [kubectl](https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html)\n- [flux](https://fluxcd.io/docs/get-started/)\n- [Helm](https://helm.sh/docs/intro/install/)\n\n## Local Installation\n\nFor local installation simply follow the instructions found on the official [Crossplane documentation](https://crossplane.io/docs/v1.7/getting-started/install-configure.html).\n\n```bash\n# install latest Crossplane release using Helm in a dedicated namespace\nkubectl create namespace crossplane-system\n\nhelm repo add crossplane-stable https://charts.crossplane.io/stable\nhelm repo update\n\nhelm install crossplane --namespace crossplane-system crossplane-stable/crossplane --set provider.packages={crossplane/provider-aws:v0.24.1}\n\n## check everything came up OK\nhelm list -n crossplane-system\nkubectl get all -n crossplane-system\n```\n\n## Bootstrapping\n\n```bash\n# define required ENV variables for the next steps to work\n$ export AWS_ACCOUNT_ID=`aws sts get-caller-identity --query Account --output text`\n$ export GITHUB_USER=lreimer\n$ export GITHUB_TOKEN=\u003cyour-token\u003e\n\n# setup an EKS cluster with Flux2\n$ make create-eks-cluster\n$ make bootstrap-eks-flux2\n\n# setup a GKE cluster with Flux2\n$ make create-gke-cluster\n$ make bootstrap-gke-flux2\n\n# modify Flux kustomization and add\n# - cluster-sync.yaml\n# - notification-receiver.yaml\n# - receiver-service.yaml\n# - webhook-token.yaml\n# - image-update-automation.yaml\n\n# you also need to create the webhook for the Git Repository\n# Payload URL: http://\u003cLoadBalancerAddress\u003e/\u003cReceiverURL\u003e\n# Secret: the webhook-token value\n$ kubectl -n flux-system get svc/receiver\n$ kubectl -n flux-system get receiver/webapp\n\n$ make destroy-clusters\n```\n\n## AWS Provider\n\nFor AWS the configuration needs to reference the required credentials in the form of a secret.\nThese are basically the `aws_access_key_id` and `aws_secret_access_key` from the default profile found in the `${HOME}/.aws/credentials` file. With this information we can create a secret and reference it from a provider config resource.\n\n```bash\nkubectl create secret generic aws-credentials -n crossplane-system --from-file=credentials=${HOME}/.aws/credentials\n\n# we could manually installe the AWS provider\n# kubectl crossplane install provider crossplane/provider-aws:v0.24.1\n\ncd crossplane/aws/\nkubectl apply -n crossplane-system -f provider.yaml\nkubectl apply -n crossplane-system -f providerconfig.yaml\n\nkubectl get events\nkubectl get crds\n\n# create an S3 bucket in eu-central-1\nkubectl apply -f s3/bucket.yaml\naws s3 ls\n\n# create an ECR in eu-central-1\nkubectl apply -f ecr/repository.yaml\naws ecr describe-repositories\n\n# create SNS topic and subscription\nkubectl apply -f sns/topic.yaml\naws sns list-topics\nkubectl apply -f sns/subscription.yaml\naws sns list-subscriptions\naws sns publish --subject Test --message Crossplane --topic-arn arn:aws:sns:eu-central-1:\u003cAWS_ACCOUNT_ID\u003e:email-topic\n\n# create a SQS queue\nkubectl apply -f sqs/queue.yaml\naws sqs list-queues\n\n# create Aurora Serverless\nkubectl apply -f db/aurora-serverless.yaml\naws rds describe-db-clusters\nkubectl apply -f db/aurora-client.yaml\n\n# use XRD to create an ECR\nkubectl apply -f xrd/repository/definition.yaml\nkubectl apply -f xrd/repository/composition.yaml\nkubectl apply -f xrd/repository/examples/example-repository.yaml\n\ncd xrd/repository/\nkubectl crossplane build configuration --ignore=examples/example-repository.yaml\n\n# use XRD to create an S3 bucket\nkubectl apply -f xrd/bucket/definition.yaml\nkubectl apply -f xrd/bucket/composition.yaml\nkubectl apply -f xrd/bucket/examples/example-bucket.yaml\n\ncd xrd/bucket/\nkubectl crossplane build configuration --ignore=examples/example-bucket.yaml\n\n# use XRD to create PostgreSQL instance\nkubectl apply -f xrd/postgresql/definition.yaml\nkubectl apply -f xrd/postgresql/composition.yaml\nkubectl apply -f xrd/postgresql/examples/example-db.yaml\n\nkubectl get postgresqlinstances.db.aws.qaware.de example-db\nkubectl get claim\n\nkubectl get secrets\nkubectl describe secret example-db-conn\n\nkubectl apply -f xrd/postgresql/examples/example-db-client.yaml\nkubectl get pods\nkubectl logs example-db-client-sjdh7\n\ncd xrd/postgresql/\nkubectl crossplane build configuration --ignore=examples/example-db.yaml,examples/example-db-client.yaml\n```\n\n## GCP Provider\n\nFor examples of the GCP provider have a look the [Github repository](https://github.com/crossplane/provider-gcp/tree/master/examples)\n\n```bash\n# we need to create a GCP service account and secret\ngcloud iam service-accounts create crossplane-system --display-name=Crossplane\ngcloud projects add-iam-policy-binding cloud-native-experience-lab --role=roles/iam.serviceAccountUser --member serviceAccount:crossplane-system@cloud-native-experience-lab.iam.gserviceaccount.com\ngcloud projects add-iam-policy-binding cloud-native-experience-lab --role=roles/storage.admin --member serviceAccount:crossplane-system@cloud-native-experience-lab.iam.gserviceaccount.com\n\ngcloud iam service-accounts keys create gcp-credentials.json --iam-account crossplane-system@cloud-native-experience-lab.iam.gserviceaccount.com\n\nkubectl create secret generic gcp-credentials -n crossplane-system --from-file=credentials=./gcp-credentials.json\n\n# we could manually installe the AWS provider\n# kubectl crossplane install provider crossplane/provider-gcp:v0.21.0\n\ncd crossplane/gcp/\nkubectl apply -n crossplane-system -f provider.yaml\nkubectl apply -n crossplane-system -f providerconfig.yaml\n\n# create an storage bucket in eu-central-1\nkubectl apply -f storage/bucket.yaml\ngsutil ls\n```\n\n## Maintainer\n\nM.-Leander Reimer (@lreimer), \u003cmario-leander.reimer@qaware.de\u003e\n\n## License\n\nThis software is provided under the MIT open source license, read the `LICENSE`\nfile for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flreimer%2Fmastering-gitops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flreimer%2Fmastering-gitops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flreimer%2Fmastering-gitops/lists"}