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.

Deploy Workload

Deploy Workload Success

  1. Open Kubectl Terminal to verify workload status.

K8s Terminal

Application will be:

  1. Pulled from registry
  2. Scheduled on cluster
  3. Started as containers
  4. Exposed via service

Monitor Application

Application Status

Check deployment status:

Application Status

States:

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

View Logs

Access application logs:

kubectl logs deployment/<app-name>

Or through UI:

Application Logs

Performance Metrics

Monitor application metrics:

Application Metrics

  • Request rate
  • Response time
  • Error rate
  • CPU/Memory usage

Manage Application

Update Application

Deploy new version:

  1. Push new image
  2. Update deployment
  3. Trigger rolling update

Update Application

Scale Application

Adjust replicas:

kubectl scale deployment/<app-name> --replicas=5

Or through UI:

  1. Select application
  2. Click Scale
  3. Set replica count
  4. Confirm

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

Delete Application

Stop Application

Stop application:

  1. Select application
  2. Click Stop
  3. Confirm stopping

Application can be restarted later.

Stop Application

Delete Application

Permanently remove:

  1. Select application
  2. Click Delete
  3. Confirm deletion

Delete Application

Resources are freed and returned to quota.

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