№ 10280 В разделах: Programming
Sysadmin
от September 1st, 2019,
В подшивках: Go, Security, Vault
I wrote small program to retrieve secrets from Vault and provide them to my PHP and Python apps. ENV variables with connection credentials is useful with Docker containers and even Kubernetes, list of secrets to retrieve can be stored inside Docker image.
Secret stored in Vault
Result file on disk
Source code and binary release https://git.blindage.org/21h/vault-retriever
№ 10268 В разделе "Programming"
от August 30th, 2019,
В подшивках: Go, Operator SDK
1) Install operator-sdk on your computer https://github.com/operator-framework/operator-sdk/blob/master/doc/user/install-operator-sdk.md. I prefer to install into $GOPATH/bin
.
2) create script somewhere like /opt/bootstrap_operator.sh
#!/bin/bash set -e REPO="git.blindage.org/21h/redis-operator" API_VERSION="blindage.org/v1alpha1" KIND="Redis" NAME="redis-operator" # operator sdk export GO111MODULE=on echo "Bootstraping ${NAME}" operator-sdk new ${NAME} --git-init --repo ${REPO} --verbose cd ${NAME} echo "Adding API ${API_VERSION}" operator-sdk add api --api-version=${API_VERSION} --kind=${KIND} --verbose echo "Creating controller" operator-sdk add controller --api-version=${API_VERSION} --kind=${KIND} --verbose
3) change directory to your “~/dev
” and run script bash /opt/bootstrap_operator.sh
, it will create new directory “~/dev/redis-operator
”
4) build your new operator, pack to image operator-sdk build redis-operator
5) push new image to registry with docker push myregistry.ru/redis-operator
№ 10254 В разделах: Programming
Sysadmin
от August 27th, 2019,
В подшивках: Go, Kubernetes, Kubernetes Operator, Operator SDK, Redis
Redis operator runs Sentinel and Redis, makes Redis high available with HAProxy.
№ 10248 В разделах: Programming
Sysadmin
от August 23rd, 2019,
В подшивках: Go, Kubernetes, Kubernetes Operator, MQTT, Operator SDK
Run multiple MQTT instances in your Kubernetes cluster. Can store persistent database.
Documentation and download here https://git.blindage.org/21h/mqtt-operator
№ 10240 В разделах: Programming
Sysadmin
от August 22nd, 2019,
В подшивках: Django, Go, Kubernetes, Kubernetes Operator, Operator SDK
You can run projects with collectstatic and migrations at init stage, provide ENVs, service and pods annotations.
https://git.blindage.org/21h/django-operator
Full Spec:
image specific settings
PullPolicy
: 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
Fortune cookie: Confucious say: man who kicked in testicles get left holding bag.