Deploying Example App with rackctl SSL and Ingress

This guide walks through deploying an example web app accessible at http://app1.dev.example.com/example using Kubernetes, rackctl for SSL management, and NGINX Ingress.

1. Generate SSL with rackctl

Use the following command to provision SSL for your domain:

rackctl gen-ssl app1.dev.example.com

Note: SSL termination is handled entirely by the rackctl system. Do not configure SSL-related annotations in your Kubernetes Ingress.

2. Create Ingress Resource

Create an ingress file named ingress.yaml:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-prod
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"     # 1 hour timeout
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"     # 1 hour timeout
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"    # 60 seconds
    nginx.ingress.kubernetes.io/enable-websocket: "true"       # WebSocket support
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
  ingressClassName: nginx
  rules:
    - host: app1.dev.example.com
      http:
        paths:
          - path: /example
            pathType: Prefix
            backend:
              service:
                name: example-service
                port:
                  number: 80

3. Create Deployment for the App

Save the following as example-app/deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-deploy
  labels:
    app: example-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: example-app
  template:
    metadata:
      labels:
        app: example-app
    spec:
      containers:
        - name: example-app
          image: docker.io/gingersociety/example-service
          ports:
            - containerPort: 80

4. Create Service for the App

Save the following as example-app/service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: example-service
  labels:
    app: example-app
spec:
  selector:
    app: example-app
  ports:
    - protocol: TCP
      name: http
      port: 80
      targetPort: 80

5. Deploy Resources

Apply the Kubernetes resources:

kubectl apply -f example-app/deployment.yaml
kubectl apply -f example-app/service.yaml
kubectl apply -f ingress.yaml

6. Access the Application

Once deployed and ingress is applied, access the app in your browser:

https://app1.dev.example.com/example

Notes