Skip to content

Platform

Platform management and configuration.

Accessing services

All platform services are accessible via port-forwarding:

# Set up all port forwards
./scripts/setup-port-forwards.sh

# Or individually
kubectl port-forward -n playpen-platform svc/jenkins 8080:8080
kubectl port-forward -n playpen-platform svc/nexus 8081:8081
kubectl port-forward -n playpen-platform svc/dex 5556:5556
kubectl port-forward -n playpen-platform svc/postgres 5432:5432

Service discovery

Services are accessible within the cluster using Kubernetes DNS:

  • Jenkins: jenkins.playpen-platform.svc.cluster.local:8080
  • Nexus: nexus.playpen-platform.svc.cluster.local:8081
  • Dex: dex.playpen-platform.svc.cluster.local:5556
  • PostgreSQL: postgres.playpen-platform.svc.cluster.local:5432

Checking service status

# Check all pods
kubectl get pods -n playpen-platform

# Check specific service
kubectl get pods -n playpen-platform -l app=jenkins

# View logs
kubectl logs -n playpen-platform deployment/jenkins

Storage management

View persistent volumes

kubectl get pvc -n playpen-platform

Backup data

# Backup PostgreSQL
kubectl exec -n playpen-platform postgres-0 -- \
  pg_dump -U playpen playpen > backup.sql

# Backup Nexus data
kubectl exec -n playpen-platform deployment/nexus -- \
  tar czf /tmp/nexus-backup.tar.gz /nexus-data
kubectl cp playpen-platform/$(kubectl get pod -n playpen-platform -l app=nexus -o jsonpath='{.items[0].metadata.name}'):/tmp/nexus-backup.tar.gz ./nexus-backup.tar.gz

Resource management

View resource usage

# CPU and memory usage
kubectl top pods -n playpen-platform

# Resource requests and limits
kubectl describe pod -n playpen-platform <pod-name>

Scale services

# Scale Jenkins (if needed)
kubectl scale statefulset jenkins -n playpen-platform --replicas=2

Configuration updates

Update service configuration

Most services use ConfigMaps for configuration:

# View ConfigMap
kubectl get configmap -n playpen-platform

# Edit ConfigMap
kubectl edit configmap <configmap-name> -n playpen-platform

# Restart pods to apply changes
kubectl rollout restart deployment/<service-name> -n playpen-platform

Troubleshooting

Pod not starting

# Check pod events
kubectl describe pod <pod-name> -n playpen-platform

# Check logs
kubectl logs <pod-name> -n playpen-platform

# Check previous container logs (if crashed)
kubectl logs <pod-name> -n playpen-platform --previous

Service not accessible

# Verify service exists
kubectl get svc -n playpen-platform

# Check endpoints
kubectl get endpoints -n playpen-platform

# Test connectivity from within cluster
kubectl run -it --rm debug --image=busybox --restart=Never -- \
  wget -O- http://jenkins.playpen-platform.svc.cluster.local:8080

Next steps