Django Operator for Kubernetes
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
Vladimir Smagin 06d5f8b2a4 go mod 7 mesi fa
build simple run 11 mesi fa
cmd/manager simple run 11 mesi fa
deploy bump version 7 mesi fa
pkg add labeling 7 mesi fa
vendor no more latest tag, use vendor, add jenkins pipeline 7 mesi fa
version bump version 7 mesi fa
.gitignore simple run 11 mesi fa
Dockerfile no more latest tag, use vendor, add jenkins pipeline 7 mesi fa
Jenkinsfile no more latest tag, use vendor, add jenkins pipeline 7 mesi fa
README.md readme 11 mesi fa
VERSION fix helm chart 7 mesi fa
go.mod go mod 7 mesi fa
go.sum no more latest tag, use vendor, add jenkins pipeline 7 mesi fa
tools.go simple run 11 mesi fa

README.md

Django operator for Kubernetes

Can run simple projects with collectstatic and migrations at init stage. In some cases you can run non-django images like hello-world below, just set Django specific flags to False and statics path to /notexists.

Build sources

Prebuilt images

You can find images here https://hub.docker.com/r/iam21h/django-operator

Deploy operator

kubectl -f deploy/service_account.yaml
kubectl -f deploy/role.yaml
kubectl -f deploy/role_binding.yaml
kubectl -f deploy/operator.yaml

Your first Django deployment

This resource can help you run your first image

apiVersion: blindage.org/v1alpha1
kind: Django
metadata:
  name: django-test
spec:
  pullPolicy: IfNotPresent
  image: gcr.io/hello-minikube-zero-install/hello-node:latest
  replicas: 1

  # application port, default 8080
  appPort: 8080

  # path where you store static files, typicaly inside application home
  appStaticPath: "/app/static"

  # run migrations in init container before run
  runMigrate: False

  # run collectstatic in init container before run
  runCollectStatic: False

Full Spec

image specific settings

  • PullPolicy: its usual imagePullPolicy, default IfNotPresent
  • Image: string, required, format <image>:<tag>
  • Replicas: integer, default 1

manage resources

Read more about resources limiting here https://kubernetes.io/docs/concepts/policy/resource-quotas/

  • PodRequests: default is empty
  • PodLimits: default is empty

Affinity and antiaffinity manual https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

  • Affinity: default is empty

set annotations to service and pod

  • ServiceAnnotations: <key>: <value> dict, default is empty
  • PodAnnotations: <key>: <value> dict, default is empty

application specific configuration

  • AppPort: integer, internal application port, default 8000
  • AppEnv: EnvVar array, default is empty
  • AppStaticPath: string, path to static files, default /app/static
  • RunMigrate: bool, run migrations at init stage, default False
  • RunCollectStatic: bool, run collectstatic at init stage, default False

Copyright by Vladimir Smagin (21h) 2019
http://blindage.org email: 21h@blindage.org
Project page: https://git.blindage.org/21h/django-operator