Cruma
DashboardDownload

Expose an app with Argo CD

🧪 Private preview

The Kubernetes ingress controller is in private preview. Its manifests and options can change before general availability.

Once the controller is installed with Argo CD, each app's own Application carries its Ingress or HTTPRoute next to its Deployment and Service. Nothing in the app's Application refers to the controller.

With an Ingress

Keep the app's manifests in a directory of your repository:

# apps/shop/shop.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: shop
spec:
  replicas: 1
  selector:
    matchLabels: {app: shop}
  template:
    metadata:
      labels: {app: shop}
    spec:
      containers:
        - name: shop
          image: nginx:1.27-alpine
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: shop
spec:
  selector: {app: shop}
  ports:
    - port: 80
      targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
spec:
  ingressClassName: cruma
  rules:
    - host: shop               # shop.<tunnel-id>.tun.cruma-cust1.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: shop
                port:
                  number: 80
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: shop
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://git.example.com/acme/platform.git
    targetRevision: main
    path: apps/shop
  destination:
    server: https://kubernetes.default.svc
    namespace: shop
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

For a per-app install, use ingressClassName: cruma-<app> instead.

With an HTTPRoute

Add the Gateway and the route to the app's directory. The Gateway's class is cruma, which the install creates when you include gatewayclass.yaml:

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: web
spec:
  gatewayClassName: cruma
  listeners:
    - name: http
      protocol: HTTP
      port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: shop
spec:
  parentRefs:
    - name: web
  hostnames:
    - shop-route
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: shop
          port: 80

A hostname is served by Ingresses or by HTTPRoutes, not both. Giving an HTTPRoute a hostname an Ingress already serves leaves the route Accepted=False with reason Conflicted.

What Argo CD shows

ResourceHealthy whenOtherwise
IngressThe controller has written the tunnel's address to status.loadBalancer. The Application is Progressing until thenProgressing. Nothing serves the Ingress: check that the controller runs and the class matches
GatewayProgrammed is trueNot Healthy. See the Gateway's conditions
HTTPRouteAcceptedDegraded, with the controller's reason in the resource's conditions

An Ingress the controller can't serve fully still gets the tunnel's address, so Argo CD shows it Healthy. An Exact path, an unsupported annotation or a missing backend appears only as a Warning Event on the Ingress, not in Argo CD's health:

kubectl -n shop describe ingress shop
Warning  UnsupportedValue  cruma-k8s-gateway  path /health on exact is Exact, which cruma does not support yet; use Prefix

The reasons are listed in Kubernetes ingress. On an HTTPRoute the same message is the Accepted condition, so Argo CD shows the route Degraded:

kubectl -n shop get httproute shop -o jsonpath='{.status.parents[0].conditions}'

The address Argo CD shows for the Ingress is your tunnel's hostname, as kubectl get ingress shows it. To show another, see Show another address.

Troubleshooting

SymptomLook at
Application Synced but Progressing, the Ingress has no addressThe controller isn't running, or its class isn't the Ingress's. kubectl -n cruma-system get pods, then kubectl get ingressclass (or the class your per-app install uses)
Ingress is Healthy but the host doesn't answerkubectl describe ingress <name> for Warning Events, then the controller log
HTTPRoute Degradedkubectl get httproute <name> -o yaml: the Accepted and ResolvedRefs conditions name the reason
Resource keeps going OutOfSyncCompare the live and desired manifests in Argo CD's diff view. A field another tool writes belongs in ignoreDifferences