⚠️ Although in working order, this should be considered more of a "POC" for the time being. You can watch the video if you're just looking for a quickstart.
This is a "self contained" and "self bootstrapping" OpenShift CI/CD Demo, that uses OpenShift Pipelines (Tekton) in tandem with OpenShift GitOps (Argo CD) to deliver a cloud native CI/CD solution.
Once deployed, you will have the following:
- OpenShift GitOps cluster scoped deployment installed
- Tekton installed
- Custom Cluster configurations
- This includes creating a
developer
user.
- This includes creating a
The OpenShift GitOps system will then install the following:
- "Tenant" Argo CD instance under the
welcome-gitops
namespace - A GitTea instances to house all the manifests
- It also imports all the needed repos
- Sample
welcome-app
application in the following namespaceswelcome-dev
welcome-prod
- Tekton Pipeline under
welcome-pipeline
set up with the following- Builds application from source (hosted on the GitTea service)
- Image gets stored in the internal registry
- Tekton will "write back" to the GitTea instance for ArgoCD to act on
⚠️ I've tested this on OCP 4.7
To deploy this demo, you need to have the following
- A "bare" OpenShift 4.7 cluster installed
- Cluster Admin access to the cluster
oc
andkubectl
CLI installed.- Not required; but
kustomize
is useful (for debugging)
Once you have a cluster ready, login as cluster-admin
and run the following:
kubectl apply -k https://github.com/RedHatWorkshops/openshift-cicd-demo/bootstrap/overlays/base.cluster/
If you have issues, please see the troubleshooting section
Once deployed, you will need the following information.
Console route can be found using:
oc get route console -n openshift-console -o jsonpath='{.spec.host}{"\n"}'
Use the following credentials
- username:
developer
- password:
openshift
The tenant Argo CD instance is running in the welcome-gitops
namespace. To reach the Web UI:
oc get route welcome-argocd-server -n welcome-gitops -o jsonpath='{.spec.host}{"\n"}'
The password for the tenant Argo CD instance can be extracted by:
oc extract secret/welcome-argocd-cluster -n welcome-gitops --to=-
The Git service route can be found by:
oc get route gitea -n scm -o jsonpath='{.spec.host}{"\n"}'
Use the following credentials for the demo:
- username:
developer
- password:
openshift
You will see two repos; welcome-app
and welcome-deploy
.
welcome-app
repo is the code repo that builds the applicationwelcome-deploy
repo is the repo with the deployment manifest.
The application is deployed to two namespaces: welcome-dev
and welcome-prod
You can find the routes using the following:
Dev
oc get route welcome-app -n welcome-dev -o jsonpath='{.spec.host}{"\n"}'
Prod
oc get route welcome-app -n welcome-prod -o jsonpath='{.spec.host}{"\n"}'
Make a commit to the index.php
file at the following URL:
echo $(oc get route gitea -n scm -o jsonpath='{.spec.host}')/developer/welcome-app
This should fire off a build that you can see progress in the
welcome-pipeline
namespace. It's probably easier to just show you, so
watch this video:
Common issues that may arise are in this section in no particular order.
You're probably always going to end up here since the install won't work "first shot". Best way to install is to run the following:
until kubectl apply -k https://github.com/RedHatWorkshops/openshift-cicd-demo/bootstrap/overlays/base.cluster/
do
sleep 5
done
The OpenShift GitOps installation (aka the "Cluster Argo CD) can be reached by the following route:
oc get route openshift-gitops-server -n openshift-gitops -o jsonpath='{.spec.host}{"\n"}'
The Admin password can be found by:
oc extract secret/openshift-gitops-cluster -n openshift-gitops --to=-
In case you need it, the GitTea Admin credentials:
- giteaAdminUser:
gitea-admin
- giteaAdminPassword:
openshift