Your first deployment
Deploy nginx from your own Git repo through ArgoCD and reach it at https://demo.<tenant>.kestrel.arbutus.cloud/. Your only direct write is kubectl create namespace in step 1; ArgoCD applies everything else.
Before you start:
- Your tenant is provisioned (Requesting access).
kubectl auth whoamilists youroidc:<RAP group>group (Install kubelogin).- You can push to a Git repository (GitHub, GitLab or similar).
- You have asked RCS (ticket) for a DNS record for
demo.<tenant>.kestrel.arbutus.cloud, and to enable certificates for your tenant if that isn’t done yet. Creating an Ingress does neither. You need both by step 7.
Walkthrough
Section titled “Walkthrough”-
Create a namespace.
A new tenant has no namespaces. Names must start with
<tenant>-; your tenant name is your RAP group name in lowercase.Terminal window kubectl create namespace <tenant>-demokubectl auth can-i create deployments -n <tenant>-demo # yescan-ianswersnofor a namespace that doesn’t exist, so check the name before you suspect your login. -
Create your workload repository.
Terminal window git clone https://github.com/<your-org>/<your-repo>.gitcd <your-repo>mkdir -p manifests/demo-nginxIf the repo is private, add a project-scoped repository credential in ArgoCD (Settings → Repositories) before step 5.
-
Add the Deployment.
Kyverno enforces the PodSecurity
restrictedprofile on every Pod, so keep thesecurityContextfields as they are.manifests/demo-nginx/deployment.yaml apiVersion: apps/v1kind: Deploymentmetadata:name: demo-nginxnamespace: <tenant>-demospec:replicas: 1selector:matchLabels:app: demo-nginxtemplate:metadata:labels:app: demo-nginxspec:priorityClassName: uber-user-significant # see /running/priority-classes/securityContext:runAsNonRoot: truerunAsUser: 101seccompProfile:type: RuntimeDefaultcontainers:- name: nginximage: nginxinc/nginx-unprivileged:1.27-alpineports:- containerPort: 8080securityContext:allowPrivilegeEscalation: falsereadOnlyRootFilesystem: true # optional hardening; needs the emptyDirs belowcapabilities:drop: [ALL]resources:requests:cpu: 100mmemory: 64Milimits:cpu: 200mmemory: 128MivolumeMounts:- name: tmpmountPath: /tmp- name: cachemountPath: /var/cache/nginx- name: runmountPath: /var/runvolumes:- name: tmpemptyDir: {}- name: cacheemptyDir: {}- name: runemptyDir: {} -
Add the Service and Ingress.
Services must be
ClusterIP;LoadBalancerandNodePortare denied. Thewebsecureentrypoint makes the route HTTPS-only, sohttp://returns 404. See Ingress.manifests/demo-nginx/service.yaml apiVersion: v1kind: Servicemetadata:name: demo-nginxnamespace: <tenant>-demospec:type: ClusterIPselector:app: demo-nginxports:- port: 80targetPort: 8080manifests/demo-nginx/ingress.yaml apiVersion: networking.k8s.io/v1kind: Ingressmetadata:name: demo-nginxnamespace: <tenant>-demoannotations:cert-manager.io/cluster-issuer: letsencrypt-prodtraefik.ingress.kubernetes.io/router.entrypoints: websecuretraefik.ingress.kubernetes.io/router.tls: "true"spec:ingressClassName: traefiktls:- hosts:- demo.<tenant>.kestrel.arbutus.cloudsecretName: demo-nginx-tlsrules:- host: demo.<tenant>.kestrel.arbutus.cloudhttp:paths:- path: /pathType: Prefixbackend:service:name: demo-nginxport:number: 80 -
Push, then create the ArgoCD Application.
Terminal window git add manifests/demo-nginx/git commit -m "Add demo-nginx"git push origin mainLog in to ArgoCD at
https://kestrel.arbutus.cloud/argocd(Keycloak, same account askubelogin), click New App, and fill in:Field Value Application Name <tenant>-demo-nginxProject <tenant>: your tenant’s AppProject (lowercase), the only one you can selectSync Policy Automatic, with Prune Resources and Self HealRepository URL your repo’s HTTPS URL Path manifests/demo-nginxCluster URL https://kubernetes.default.svc(ArgoCD’s in-cluster address)Namespace <tenant>-demoFor repos with several workloads, or to create Applications with
kubectl, see Your repo, your workloads. -
Check the sync.
The Application should reach
SyncedandHealthywithin a minute.Terminal window kubectl get pods,ingress,certificate -n <tenant>-demokubectl logs -n <tenant>-demo deployment/demo-nginxExpect one
RunningPod and an Ingress fordemo.<tenant>.kestrel.arbutus.cloud. The Certificatedemo-nginx-tlscan beREADY: Truebefore the hostname resolves, because cert-manager validates it through RCS’s DNS rather than over HTTP. If the Application isSyncedbut no Pod appears, see the first row of the table below. -
Open the app.
https://demo.<tenant>.kestrel.arbutus.cloud/shows the nginx welcome page with a valid certificate once RCS has created the DNS record.
If something goes wrong
Section titled “If something goes wrong”| Symptom | Cause and fix |
|---|---|
Application Synced, but no Pods; kubectl describe rs -n <tenant>-demo shows a validate.kyverno.svc-fail PodSecurity denial | A securityContext field was changed or removed. Restore the step 3 manifest. The denial appears only in the ReplicaSet’s events, not in the ArgoCD sync message or on the Deployment. |
Capsule denies kubectl create namespace | The name doesn’t start with <tenant>-. See Namespace prefix. |
kubectl auth whoami doesn’t list your oidc:<RAP group> group | You haven’t been added to the tenant’s Keycloak group yet. Ask RCS; see Install kubelogin. |
| Hostname doesn’t resolve | There is no DNS record yet. Ask RCS; see Ingress. |
Browser certificate warning; kubectl get certificaterequest -n <tenant>-demo shows empty APPROVED and DENIED columns | Certificates aren’t enabled for your tenant. Ask RCS; see TLS. |
For anything else, see Triage or the Troubleshooting index.
Next steps
Section titled “Next steps”- Workload recipes: services, batch jobs and dev pods.
- ArgoCD and Your repo, your workloads.
- Priority classes: which
priorityClassNameto use.