Red Hat OpenShift application deployment examples.
- services # Services
- number # A demo service that generates a random number (Go code)
- view # A demo service that displays the random number (Go code)
- ocp # OpenShift deployment and management resources
- deployments # ArgoCD Application resources for the services
- helm ä Helm value files
- basic # Helm value files for the basic deployment via Helm chart
- manifests # Kubernetes manifests for the services (different deployment strategies)
- basic # Kubernetes manifests for the basic deployment
- progressive # Kubernetes manifests for the progressive deployment
- helm-charts # Helm charts for the services
- number-service # Helm chart for the number service
- view-service # Helm chart for the view service
- OpenShift >= 4.17 cluster
- Enabled GitOps subscription in the OpenShift cluster (ArgoCD)
oc
CLI installed and configured to access the OpenShift cluster
Before we can deploy any of the services, we need to modify our central ArgoCD management application to allow sourcing Application
resources from other than the openshift-gitops
namespace. This is necessary because the services are deployed in a separate project, namespace and ArgoCD application and by default, ArgoCD only watches the openshift-gitops
namespace for Application
resources.
To do this, execute the following patch command:
oc -n openshift-gitops patch argocds.argoproj.io openshift-gitops \
--type merge \
--patch '{"spec":{"sourceNamespaces":["openshift-gitops","example-application-basic","example-application-basic-servicemesh","example-application-progressive","example-application-helm-basic","example-application-helm-progressive"]}}'
The openshift-gitops
namespace is the default
namespace and might not be necessary to add to the sourceNamespaces
list. However, it is added here for completeness.
- Clone the repository
git clone git@github.com:leonsteinhaeuser/rh-ocp-examples.git
cd rh-ocp-examples
- Deploy the management app and project
oc apply --server-side -f ./
-
Wait for ArgoCD to sync the other project setup manifests stored in the
ocp/deployments
directory -
Wait for the ArgoCD services and applications to be created