Skip to main content

Custom Application Deployment

Overview

Application deployment enables you to run custom applications and web services on your clusters, making them accessible via HTTP endpoints.

Prepare Application

Application Requirements

Your application should:

  • Be containerized (Docker/OCI image)
  • Listen on a configurable port (typically 8080)
  • Have health check endpoints
  • Handle graceful shutdown
  • Log to standard output

Dockerfile Example

FROM python:3.9-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY app.py .

EXPOSE 8080
CMD ["python", "app.py"]

Deploy Application

Step 1: Prepare Image

Build and push Docker image:

docker build -t myregistry/myapp:v1.0 .
docker push myregistry/myapp:v1.0

Step 2: Deploy Workload from the Cluster

  1. Open the created cluster from the cluster list.
  2. Go to the Workloads tab.
  3. Click Add Workloads.

Cluster List

Cluster Workloads

  1. In the workload form, set:

    • Configuration Method: Manual Configuration
    • Name (e.g., nginx-workload)
    • Namespace (e.g., nginx)
    • Repository URL (e.g., https://gitlab.com/api/v4/projects/54152051/packages/helm/devel)
    • Chart (e.g., nginx)
    • Version (e.g., 17.0.0)
    • Values (optional)
  2. Click Submit.

    • Application will be:
      • Pulled from registry
      • Scheduled on cluster
      • Started as containers
      • Exposed via service

Deploy Workload

Deploy Workload Success

Monitor Application

Application Status via Kubectl Terminal

Open Kubectl Terminal to verify workload status.

info

Workload States:

  • Deploying - Rolling out
  • Running - Serving requests
  • Failed - Deployment error
  • Scaling - Adjusting replicas

K8s Terminal

Application Status via Kubernetes Dashboard

Application status is shown in the Kubernetes dashboard.

Application status in Kubernetes dashboard

View Logs

Access application logs:

kubectl logs deployment/<app-name>

Application logs

Manage Application

Update Application

To deploy a new version:

  1. Push the new image to your registry.
  2. Update the deployment (image or manifest).
  3. Trigger a rolling update.
kubectl set image deployment/<deployment-name> <container-name>=<image-name>:<tag>

Update Application

Scale Application

To adjust replicas:

  1. Select the application.
  2. Click Scale.
  3. Set the replica count.
  4. Confirm.
kubectl scale deployment/<app-name> --replicas=5

Scale Application

Expose Application

Create Service

Expose application via service:

apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: myapp

Create Ingress

Route traffic via HTTP:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: myapp-ingress
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /
backend:
service:
name: myapp-service
port:
number: 80

Access Application

Access via endpoint:

https://myapp-endpoint.domain.com

Best Practices

Application Design

  • Stateless application design
  • 12-factor app principles
  • Health checks on startup
  • Graceful shutdown handling

Containerization

  • Minimal base images
  • Layer caching optimization
  • Security scanning
  • Multi-stage builds

Deployment

  • Version all images
  • Use image tags (not latest)
  • Test images before deployment
  • Rolling updates for zero-downtime
  • Resource limits and requests

Monitoring

  • Comprehensive logging
  • Metrics collection
  • Error tracking
  • Performance monitoring

Common Applications

  • Web APIs
  • Microservices
  • Frontend applications
  • Batch processors
  • Scheduled jobs

Next Steps