Skip to content

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 whoami lists your oidc:<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.
  1. 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>-demo
    kubectl auth can-i create deployments -n <tenant>-demo # yes

    can-i answers no for a namespace that doesn’t exist, so check the name before you suspect your login.

  2. Create your workload repository.

    Terminal window
    git clone https://github.com/<your-org>/<your-repo>.git
    cd <your-repo>
    mkdir -p manifests/demo-nginx

    If the repo is private, add a project-scoped repository credential in ArgoCD (Settings → Repositories) before step 5.

  3. Add the Deployment.

    Kyverno enforces the PodSecurity restricted profile on every Pod, so keep the securityContext fields as they are.

    manifests/demo-nginx/deployment.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: demo-nginx
    namespace: <tenant>-demo
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: demo-nginx
    template:
    metadata:
    labels:
    app: demo-nginx
    spec:
    priorityClassName: uber-user-significant # see /running/priority-classes/
    securityContext:
    runAsNonRoot: true
    runAsUser: 101
    seccompProfile:
    type: RuntimeDefault
    containers:
    - name: nginx
    image: nginxinc/nginx-unprivileged:1.27-alpine
    ports:
    - containerPort: 8080
    securityContext:
    allowPrivilegeEscalation: false
    readOnlyRootFilesystem: true # optional hardening; needs the emptyDirs below
    capabilities:
    drop: [ALL]
    resources:
    requests:
    cpu: 100m
    memory: 64Mi
    limits:
    cpu: 200m
    memory: 128Mi
    volumeMounts:
    - name: tmp
    mountPath: /tmp
    - name: cache
    mountPath: /var/cache/nginx
    - name: run
    mountPath: /var/run
    volumes:
    - name: tmp
    emptyDir: {}
    - name: cache
    emptyDir: {}
    - name: run
    emptyDir: {}
  4. Add the Service and Ingress.

    Services must be ClusterIP; LoadBalancer and NodePort are denied. The websecure entrypoint makes the route HTTPS-only, so http:// returns 404. See Ingress.

    manifests/demo-nginx/service.yaml
    apiVersion: v1
    kind: Service
    metadata:
    name: demo-nginx
    namespace: <tenant>-demo
    spec:
    type: ClusterIP
    selector:
    app: demo-nginx
    ports:
    - port: 80
    targetPort: 8080
    manifests/demo-nginx/ingress.yaml
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: demo-nginx
    namespace: <tenant>-demo
    annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    spec:
    ingressClassName: traefik
    tls:
    - hosts:
    - demo.<tenant>.kestrel.arbutus.cloud
    secretName: demo-nginx-tls
    rules:
    - host: demo.<tenant>.kestrel.arbutus.cloud
    http:
    paths:
    - path: /
    pathType: Prefix
    backend:
    service:
    name: demo-nginx
    port:
    number: 80
  5. Push, then create the ArgoCD Application.

    Terminal window
    git add manifests/demo-nginx/
    git commit -m "Add demo-nginx"
    git push origin main

    Log in to ArgoCD at https://kestrel.arbutus.cloud/argocd (Keycloak, same account as kubelogin), click New App, and fill in:

    FieldValue
    Application Name<tenant>-demo-nginx
    Project<tenant>: your tenant’s AppProject (lowercase), the only one you can select
    Sync PolicyAutomatic, with Prune Resources and Self Heal
    Repository URLyour repo’s HTTPS URL
    Pathmanifests/demo-nginx
    Cluster URLhttps://kubernetes.default.svc (ArgoCD’s in-cluster address)
    Namespace<tenant>-demo

    For repos with several workloads, or to create Applications with kubectl, see Your repo, your workloads.

  6. Check the sync.

    The Application should reach Synced and Healthy within a minute.

    Terminal window
    kubectl get pods,ingress,certificate -n <tenant>-demo
    kubectl logs -n <tenant>-demo deployment/demo-nginx

    Expect one Running Pod and an Ingress for demo.<tenant>.kestrel.arbutus.cloud. The Certificate demo-nginx-tls can be READY: True before the hostname resolves, because cert-manager validates it through RCS’s DNS rather than over HTTP. If the Application is Synced but no Pod appears, see the first row of the table below.

  7. 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.

SymptomCause and fix
Application Synced, but no Pods; kubectl describe rs -n <tenant>-demo shows a validate.kyverno.svc-fail PodSecurity denialA 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 namespaceThe name doesn’t start with <tenant>-. See Namespace prefix.
kubectl auth whoami doesn’t list your oidc:<RAP group> groupYou haven’t been added to the tenant’s Keycloak group yet. Ask RCS; see Install kubelogin.
Hostname doesn’t resolveThere is no DNS record yet. Ask RCS; see Ingress.
Browser certificate warning; kubectl get certificaterequest -n <tenant>-demo shows empty APPROVED and DENIED columnsCertificates aren’t enabled for your tenant. Ask RCS; see TLS.

For anything else, see Triage or the Troubleshooting index.