Here is your GitHub Markdown formatted blog post:
OpenShift clusters can streamline your CI/CD workflow by integrating GitOps practices. This blog post will guide you through setting up ArgoCD, configuring Helm, and deploying an application on a CRC OpenShift cluster. We will cover the following steps:
Let's dive in!
CodeReady Containers (CRC) provides a minimal OpenShift 4 cluster, making it easy to test and develop on OpenShift locally. Follow these steps to get your CRC OpenShift cluster up and running:
Download and install CRC from the official Red Hat website. Make sure your system meets the minimum requirements. Once installed, start the CRC cluster:
crc setup
crc start
During the crc start
command, you’ll be prompted to provide a pull secret. You can obtain this secret from the Red Hat OpenShift Cluster Manager.
After starting the CRC, log in to your OpenShift cluster using the credentials provided:
oc login -u kubeadmin -p <password> https://api.crc.testing:6443
Replace <password>
with the one displayed at the end of the crc start
process.
To deploy Argo CD using Helm, you need to follow several steps to ensure a smooth installation and configuration of the tool. Helm is a package manager for Kubernetes that allows you to define, install, and upgrade complex Kubernetes applications. Argo CD is a popular continuous delivery tool for Kubernetes, which makes it easy to implement GitOps practices by managing application deployments in a declarative manner.
If you haven't installed Helm yet, you can install it by following the instructions on the official Helm website.
First, add the Argo CD Helm repository to your Helm client:
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
It's a good practice to deploy Argo CD in its own namespace. Create a namespace for Argo CD:
oc create namespace argocd
Now, use Helm to install Argo CD into the namespace you just created. You can use the default values or customize them as needed.
To install Argo CD with the default settings, run:
helm install argocd argo/argo-cd --namespace argocd
To verify that Argo CD has been installed correctly, you can check the pods running in the argocd
namespace:
oc get pods -n argocd
You should see several pods, including argocd-server
, argocd-repo-server
, argocd-redis
, and others.
By default, Argo CD's API server is not exposed via a LoadBalancer or Ingress. You can access it using kubectl port-forward
:
oc port-forward svc/argocd-server -n argocd 8080:443
Now you can open your web browser and go to https://localhost:8080
to access the Argo CD web UI.
The initial password for the admin user is auto-generated and stored in a Kubernetes secret. To get this password, run:
oc -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
or for PowerShell users:
oc -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) }
Use the username admin
and the password you retrieved to log in to the Argo CD UI.
If you need to customize your Argo CD installation, you can create a values.yaml
file and specify your custom configurations there. Here’s an example command to install Argo CD with custom values:
Create a values.yaml
file:
server:
service:
type: LoadBalancer
Install Argo CD using the custom values.yaml
:
helm install argocd argo/argo-cd --namespace argocd -f values.yaml
This will install Argo CD with the specified customizations.
You've now deployed Argo CD on your Kubernetes cluster using Helm! You can customize further based on your requirements, such as enabling SSL, configuring authentication, or setting up Argo CD projects and applications.
If you have any further questions or need more customization details, feel free to ask!
This format should work well for a GitHub Markdown document, and it includes all the necessary details for your CI/CD setup using OpenShift, ArgoCD, and Helm.