Welcome to the Day-2 Operations Automation Workshop.
This workshop builds on your Kubernetes and container expertise, equipping you to confidently manage and operate environments at scale. By the end of this session, you’ll be able to deploy and manage Calico Enterprise in an automated, GitOps-driven fashion.
We hope you enjoyed the presentation! You can download the slides here.
In this demo, you will:
- Deploy Gitea locally and migrate a GitHub repository containing all the ArgoCD applications needed for deploying Calico Enterprise.
- Set up ArgoCD to connect it to your cluster and the local Gitea repository.
- Deploy an app-of-apps ArgoCD application to orchestrate the deployment of Calico Enterprise onto your local cluster.
- Troubleshoot an issue
-
Calico OSS must already be installed on your cluster. We will verify this in the first chapter.
-
We will be running a script to deploy Gitea and ArgoCD. It is very important that you pass your lab name as an argument when running the script. Failure to do so or using an incorrect lab name will cause the demo to fail.
Gitea is a lightweight, self-hosted Git service ideal for local deployments. It offers an intuitive interface for managing repositories, code review, and collaboration. Learn more in the official documentation.
ArgoCD is a declarative, GitOps-based continuous delivery tool for Kubernetes. It ensures your cluster state matches the desired configuration stored in Git. Learn more in the official documentation.
ArgoCD requires a functioning CNI for intra-cluster communication. In this lab, Calico OSS has been deployed to address this requirement.
Confirm Calico OSS is running with:
kubectl get tigerastatusExpected output:
NAME AVAILABLE PROGRESSING DEGRADED SINCE
calico True False False 21s
ippools True False False 46s
The lab name will be provided by your instructor. Alternatively, you can find it in the address bar of your browser:
For example, the lab name in the image is student1.
Use the gitea-argo-setup.sh script located in your lab environment. Provide your lab name as an argument:
chmod +x /home/tigera/gitea-argo-setup.sh
/home/tigera/gitea-argo-setup.sh labname- Deploys Gitea and ArgoCD via Helm using your lab name for configuration.
- Configures Git global settings (e.g.,
user.emailanduser.name). - Pauses to allow you to:
- Log in to the local Gitea URL.
- Pull down the GitHub repository containing the ArgoCD applications.
- Clones the Gitea repository locally to the
/home/tigera/day2-gitops-workshopdirectory and makes the following updates:- Adjusts ArgoCD applications to point to the local Gitea repository.
- Updates the Tigera Manager UI Ingress resource with your lab name.
- Copies the
license.yamlfile for Calico Enterprise into the Gitea repository.
- Configures ArgoCD:
- Downloads and sets up the ArgoCD CLI.
- Logs in to ArgoCD and adds the local Gitea repository and cluster.
- Outputs the ArgoCD URL, username, and password for monitoring deployment progress.
To login to ArgoCD you can use the below information:
ARGOCD_PASSWORD=$(kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
CLUSTERNAME=$(kubectl cluster-info | grep control | awk -F "//" '{print $2}' | awk -F "." '{print $1}')
echo "ArgoCD URL: https://argocd.${CLUSTERNAME}.training.tigera.ca"
echo "ArgoCD Username: admin"
echo "ArgoCD Password: ${ARGOCD_PASSWORD}"
Take some time to examine the Gitea repository.
Here’s an overview of its structure:
Contains Helm charts for the ArgoCD applications:
- Sealed Secrets: Deploys the sealed-secrets controller.
- Calico Enterprise: Deploys the Tigera operator.
- Calico Enterprise Configs: Contains additional team-specific configurations (e.g., ingress).
- Base Policies: Contains Calico Tiers and Policies to secure the cluster from birth
Contains ArgoCD applications that point to the Helm charts in the charts directory:
sealed-secrets-app->charts/sealed-secretscalico-enterprise-app->charts/calico-enterprisecalico-configs-app->charts/calico-configsbase-policies-app->charts/base-policies
Contains the app-of-apps ArgoCD application. This application ensures all ArgoCD applications representing a full deployment are in sync.
This git repository has also been cloned locally into /home/tigera/day2-gitops-workshop and any configuration done should be done locally and not in the gitea repo
We will now add Calico Entreprise as an app in ArgoCD and deploy it. Run the following command to deploy Calico Enterprise:
argocd app create -f /home/tigera/day2-gitops-workshop/kickstart-apps/dev-team-1/calico-enterprise-standalone-deploy.yaml --grpc-webArgoCD uses a GitOps workflow to deploy applications from the Gitea repository, following these steps:
-
Infrastructure Setup:
- A sealed-secret master certificate was pre-generated during infrastructure provisioning. This certificate was used to encrypt the Tigera pull-secret, and was then deployed, as a secret (called mycustomkeys), into the
sealed-secretsnamespace. - This master secret enables the sealed-secrets deployment to decrypt sensitive information stored as encrypted secrets in the Gitea repository (e.g., the Tigera pull-secret).
- A sealed-secret master certificate was pre-generated during infrastructure provisioning. This certificate was used to encrypt the Tigera pull-secret, and was then deployed, as a secret (called mycustomkeys), into the
-
Sealed Secrets Deployment:
- ArgoCD deploys the
sealed-secretsHelm chart first. - The sealed-secrets deployment uses the master certificate to decrypt the encrypted Tigera pull-secret stored in the Gitea repository.
- ArgoCD deploys the
-
Calico Enterprise Deployment:
- ArgoCD deploys the Calico Enterprise Helm chart along with supporting resources such as:
- A storage class.
- A service account.
- The decrypted Tigera pull-secret.
- ArgoCD deploys the Calico Enterprise Helm chart along with supporting resources such as:
-
Additional Configurations:
- ArgoCD deploys any additional Calico-specific configurations, such as ingress definitions and license keys, based on the team’s requirements.
-
Base Tiers and Policies:
- ArgoCD deploys pre-defined base network tiers and policies, ensuring the cluster is secure from the outset.
This workflow ensures that all components of Calico Enterprise are deployed securely and in the correct order, leveraging the declarative and automated approach provided by ArgoCD.
If you want to keep track of how Calico Enterprise is progressing, you can watch this in the ArgoCD UI or alternatively, you can run the below command in the cluster:
watch -d kubectl get tigerastatusIt should take roughly 6 to 10 minutes to complete the deployment
Calico Enterprise looks to be deploying OK, but there is a problem with one of the applications that is always out of sync.
See if you can figure it out and correct it.
Note: Please do not edit the Gitea repo directly; instead, change your local Git repo at /home/tigera/day2-gitops-workshop/.
Solution
-
In ArgoCD, click on the
base-policiesapp. You will notice it is either constantly syncing or has errored, depending on how much time has passed. -
Clicking into it reveals the error similar to:
one or more objects failed to apply, reason: resource does not exist: Tier(platformxxxxxxxx) with error: tiers.crd.projectcalico.org "platformxxxxxxxx" not foundl. -
This indicates an issue with the
cluster-dns-allow-allpolicy. -
Click on the
platform.cluster-dns-allow-allGlobalNetworkPolicy in ArgoCD to investigate further. -
It will show as
OutOfSync.
To fix this:
# Navigate to the file and open it for editing
vi /home/tigera/day2-gitops-workshop/charts/base-policies/templates/02-policies.yaml
# Find the incorrect tier name and update it from "platformxxxxxxxx" to "platform"
# Save the changes
# Commit the changes to Git
cd /home/tigera/day2-gitops-workshop
git add charts/base-policies/templates/02-policies.yaml
git commit -m "Fixed the DNS policy"
git pushFinally, return to ArgoCD and click the Refresh button in the base-policies app to apply the corrected configuration.
You may also have to re-sync if the application sync has since failed. Or if the application is still syncing, click the 'Syncing' icon and choose 'Terminate'
Congratulations! You have completed
Day-2 Operations - Automation Workshop'!










