{"id":20155290,"url":"https://github.com/redhat-cop/declarative-openshift","last_synced_at":"2026-03-06T02:09:40.083Z","repository":{"id":53905332,"uuid":"266402674","full_name":"redhat-cop/declarative-openshift","owner":"redhat-cop","description":"Working examples of manifests for openshift for use in a declarative management strategy.","archived":false,"fork":false,"pushed_at":"2024-05-28T19:34:56.000Z","size":74,"stargazers_count":25,"open_issues_count":34,"forks_count":15,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-01-13T12:43:40.813Z","etag":null,"topics":["container-cop","gitops","openshift"],"latest_commit_sha":null,"homepage":"","language":"Smarty","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-cop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-23T19:10:31.000Z","updated_at":"2024-08-07T19:10:13.000Z","dependencies_parsed_at":"2024-05-20T22:31:38.037Z","dependency_job_id":"a82e0ed6-289b-4510-ad39-ec5b2984e26f","html_url":"https://github.com/redhat-cop/declarative-openshift","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fdeclarative-openshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fdeclarative-openshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fdeclarative-openshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-cop%2Fdeclarative-openshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-cop","download_url":"https://codeload.github.com/redhat-cop/declarative-openshift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241596244,"owners_count":19988041,"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":["container-cop","gitops","openshift"],"created_at":"2024-11-13T23:31:22.657Z","updated_at":"2026-03-06T02:09:35.039Z","avatar_url":"https://github.com/redhat-cop.png","language":"Smarty","readme":"# Declarative OpenShift\n\n### Looking for old stuff?\nAre you looking for older content that used to exist here? If so, please check out the [v1.0.0 release](https://github.com/redhat-cop/declarative-openshift/releases/tag/v1.0.0).\n\n## Overview\nThis repository contains sets of example resources to be used with a [declarative management strategy](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/). Please familiarize yourself with the terminology in that document before reading on.\n\n## Kubernetes Cluster API\nStarting with the 2.x version of this repositry, the focus is on using [Cluster API](https://cluster-api.sigs.k8s.io/) paired with a varity of tools to support the full declarative approach for OpenShift Cluster provisioning / bootstrapping, upgrades and multi-cluster \u0026 multi-account management.\n\n### CAPA - Cluster API Provider AWS\nFor managing clusters hosted on AWS, including [Red Hat OpenShift on AWS (ROSA)](https://www.redhat.com/en/technologies/cloud-computing/openshift/aws), we utilize [CAPA](https://cluster-api-aws.sigs.k8s.io/) as it nicely integrates and works together with CAPI.\n\n## OpenShift GitOps - ArgoCD\n[Red Hat OpenShift GitOps](https://www.redhat.com/en/technologies/cloud-computing/openshift/gitops) may now play a role in the entire lifecycle of a cluster, and the entire deployment. Not only can be it be used to manage the content of an operational OpenShift cluster, but it can also be used as part of a management cluster setup to manage the targeted clusters mananged with CAPI.\n\n### ClusterResourceSet\nAs part of bootstrapping a new environment, there is a need to inject new content to allow for connectivity and initial setups for connecting tooling to talk to the cluster. This can be achieved in multiple ways - including running OpenShift GitOps **in the cluster** for a full content management, or using [ClusterResourceSet](https://cluster-api.sigs.k8s.io/developer/architecture/controllers/cluster-resource-set.html) to manage a minimal set of content in the even that an external content management system is used (e.g.: running OpenShift GitOps at a centralized management cluster).\n\n## Managing OpenShift Clusters\n\n### Prerequisites\nBefore applying any of the manifests to create a new cluster(s), the following prerequisites need to be met:\n - A valid AWS account with full admin access\n - A valid account for [Red Hat Hybrid Cloud Console](https://console.redhat.com/openshift/overview)\n - [Steps 1-3 here](https://docs.aws.amazon.com/rosa/latest/userguide/getting-started-hcp.html#getting-started-hcp-step-1) to create the necessary VPC configuration and account and operator roles. \n\n**_NOTE_**: _Steps 1-3 from above will soon be replaced with declarative content within this repo. More to come on this soon..._\n\n### Management Cluster \nIn order to deploy a new OpenShift Cluster using CAPI, you will need a management cluster with the necessary CAPI and CAPA deployments in an operational state. \n\nTo get started, install the following tools on your local machine:\n - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) \n - [clusterawsadm](https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases) CLI tool\n - [clusterctl](https://cluster-api.sigs.k8s.io/user/quick-start.html#install-clusterctl) CLI tool\n - kubectl and/or oc CLI tool\n - [helm](https://helm.sh/docs/intro/quickstart/#install-helm)\n\nRun the following commands to prepare the environment and management cluster:\n```\n  export KUBECONFIG=...\n  export AWS_REGION=...\n  export AWS_ACCESS_KEY_ID=...\n  export AWS_SECRET_ACCESS_KEY=...\n  export AWS_SESSION_TOKEN=... # (optional)\n  export AWS_B64ENCODED_CREDENTIALS=$(clusterawsadm bootstrap credentials encode-as-profile)\n  export EXP_ROSA=\"true\"\n  export EXP_MACHINE_POOL=\"true\"\n  clusterctl init --infrastructure aws\n```\n\nApply customizations provided by this repo:\n\n**_Optional_**: This step is needed if your mangement cluster is an OpenShift Cluster\n\n```\n  helm template --release-name rosa-hcp charts/openshift-management | oc apply -f -\n```\n\nMake sure the CAPI pods are operational before running the next apply. \u003cbr /\u003e\nThis can be done by checking the output of the following commands:\n\n```\n  oc get pods -n capi-system\n  oc get pods -n capa-system\n  oc get pods -n capi-kubeadm-bootstrap-system\n  oc get pods -n capi-kubeadm-control-plane-system\n```\n\nApply CAPI specific configurations needed to support the upcoming workloads:\n\n```\n  helm template charts/capi-management | oc apply -f -\n```\n\n\nRun the following command to validate that everything is set up correctly, and ready for your first ROSA HCP cluster deployment with CAPI (all commands should return output containing the values in the grep part of the command):\n\n```\n  oc get crd | grep rosa\n  oc get deployment -n capa-system capa-controller-manager -o yaml | grep ROSA=true\n  oc get deploy capi-controller-manager -n capi-system -o yaml | grep MachinePool=true\n```\n\n\n### Quickstart - Simple CAPI / CAPA\n\n#### Install\nWith the above steps from the Management Cluster done, it is now time to deploy the first (workload) cluster. For this first simple quickstart, that is done in two steps:\n\n  1. Tweak the values in [charts/rosa-capi/values.yaml](charts/rosa-capi/values.yaml)\n  2. run `helm template --release-name rosa-hcp --set ocmToken=jSDFsdfsdfSDF charts/rosa-capi | oc apply -f -`\n\n**_NOTE:_** Replace the `rosa-hcp` release name and OCM Token above with your own values - alternatively set your OCM Token in the values file. The OCM Token can be fetched from https://console.redhat.com/openshift/token/rosa.\n\n#### Validation steps\nCheck the status of the the `ROSAControlPlane` deployment:\n\n```\n  oc get rosacontrolplane \u003cname-of-cluster\u003e\n```\n\nOnce the cluster shows state \"READY\" as \"true\", the cluster is available to access. Extract the kubeconfig and use it access the cluster:\n\n```\n  oc get secrets \u003ccluste-rname\u003e-kubeconfig -o jsonpath='{.data.value}' | base64 -d \u003e /tmp/rosa-capi.kubeconfig\n  export KUBECONFIG=/tmp/rosa-capi.kubeconfig\n  oc get nodes\n```\n\n#### Troubleshooting\n\n**_coming soon..._**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-cop%2Fdeclarative-openshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-cop%2Fdeclarative-openshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-cop%2Fdeclarative-openshift/lists"}