Helm chartv0.3.0App 6.17.0BSD-3-Clause

Self-hosted Python Package Index (PyPI) mirror and private package server

About this chart

Devpi Helm Chart

Production-ready Devpi PyPI server deployment on Kubernetes for Python package management and caching.

Features

  • Devpi Server: Private PyPI server with package caching
  • Persistent Storage: Volume for package data
  • Scalable: HorizontalPodAutoscaler support
  • Production Ready: Health probes, resource limits, and monitoring
  • Secure: NetworkPolicy and PodDisruptionBudget support

Prerequisites

Deployment Scenarios

This chart includes three pre-configured deployment scenarios optimized for different use cases:

Home Server (values-home-single.yaml)

Minimal resources for personal servers, home labs, Raspberry Pi, or Intel NUC:

helm install devpi-home charts/devpi \
  -f charts/devpi/values-home-single.yaml

Resource allocation: 50-250m CPU, 128-256Mi RAM, 5Gi storage

Startup Environment (values-startup-single.yaml)

Balanced configuration for small teams, startups, and development environments:

helm install devpi-startup charts/devpi \
  -f charts/devpi/values-startup-single.yaml

Resource allocation: 100-500m CPU, 256-512Mi RAM, 10Gi storage

Production HA (values-prod-master-replica.yaml)

High availability deployment with PostgreSQL and monitoring:

helm install devpi-prod charts/devpi \
  -f charts/devpi/values-prod-master-replica.yaml \
  --set postgresql.external.password=your-db-password \
  --set postgresql.external.host=postgres.default.svc.cluster.local

Features: PostgreSQL backend, PodDisruptionBudget, NetworkPolicy, ServiceMonitor

Resource allocation: 250m-1000m CPU, 512Mi-1Gi RAM, 20Gi storage

For detailed comparison and configuration examples, see the Scenario Values Guide.

  • Kubernetes 1.19+
  • Helm 3.0+
  • PersistentVolume support (for package persistence)

Quick Start

Install the Chart

helm install devpi ./charts/devpi

Access the Service

# Port-forward to access locally
kubectl port-forward svc/devpi 3141:3141

# Test the service
curl http://localhost:3141/

Configuration

Basic Configuration

ParameterDescriptionDefault
replicaCountNumber of replicas1
image.repositoryContainer image repositoryghcr.io/scriptonbasestar-containers/devpi/pypi
image.tagContainer image taglatest
image.pullPolicyImage pull policyAlways
service.typeKubernetes service typeClusterIP
service.portService port3141

Persistence

ParameterDescriptionDefault
persistence.enabledEnable persistencetrue
persistence.storageClassStorage class"" (default)
persistence.accessModeAccess modeReadWriteOnce
persistence.sizeVolume size8Gi

Health Probes

ParameterDescriptionDefault
livenessProbeLiveness probe configurationHTTP GET / on port 3141
readinessProbeReadiness probe configurationHTTP GET / on port 3141
startupProbeStartup probe configurationHTTP GET / on port 3141

Resources

resources:
  limits:
    cpu: 500m
    memory: 512Mi
  requests:
    cpu: 100m
    memory: 128Mi

Production Features

HorizontalPodAutoscaler

Automatically scale pods based on CPU usage:

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 70

Benefits:

  • Handles high package download traffic
  • Scales down during low usage
  • Ensures consistent performance

PodDisruptionBudget

Ensures minimum availability during cluster maintenance:

podDisruptionBudget:
  enabled: true
  minAvailable: 1

Benefits:

  • Prevents service outage during node maintenance
  • Controls pod eviction rate
  • Improves reliability

NetworkPolicy

Restricts network access for enhanced security:

networkPolicy:
  enabled: true
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              name: default
      ports:
        - protocol: TCP
          port: 3141

Benefits:

  • Zero-trust network security
  • Prevents unauthorized access
  • Compliance with security best practices

Requirements:

  • CNI plugin with NetworkPolicy support (Calico, Cilium, etc.)

ServiceMonitor

Enable Prometheus metrics collection:

monitoring:
  serviceMonitor:
    enabled: true
    path: /
    interval: 30s
    scrapeTimeout: 10s

Benefits:

  • Real-time performance visibility
  • Package download metrics
  • Integration with alerting systems

Requirements:

  • Prometheus Operator installed
  • ServiceMonitor CRD available

Usage Examples

Configure pip to use Devpi

# Set devpi as default index
pip config set global.index-url http://devpi:3141/root/pypi/+simple/

# Or use environment variable
export PIP_INDEX_URL=http://devpi:3141/root/pypi/+simple/

Upload packages to Devpi

# Install devpi-client
pip install devpi-client

# Login to devpi
devpi use http://devpi:3141
devpi login root --password=<password>

# Upload package
devpi upload

Troubleshooting

Check Pod Status

kubectl get pods -l app.kubernetes.io/name=devpi
kubectl describe pod <pod-name>
kubectl logs <pod-name>

Test Connection

kubectl port-forward svc/devpi 3141:3141
curl http://localhost:3141/

Access Devpi Web Interface

kubectl port-forward svc/devpi 3141:3141
# Open browser: http://localhost:3141/

License

This Helm chart is provided as-is under the MIT License.

Support

  • Devpi Documentation: https://devpi.net/
  • GitHub Issues: https://github.com/devpi/devpi/issues

Deploy devpi with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has devpi on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdevpi is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply