k8s-sidecar built to support ARM devices
865
This is a docker container intended to run inside a kubernetes cluster to collect config maps with a specified label and store the included files in an local folder. It can also send an HTTP request to a specified URL after a configmap change. The main target is to be run as a sidecar container to supply an application with information from the cluster. The contained Python script is working from Kubernetes API 1.10.
Currently (April 2018) there is no simple way to hand files in configmaps to a service and keep them updated during runtime.
Run the container created by this repo together with your application in an single pod with a shared volume. Specify which label should be monitored and where the files should be stored. By adding additional env variables the container can send an HTTP request to specified URL.
Example for a simple deployment can be found in example.yaml. Depending on the cluster setup you have to grant yourself admin rights first: kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account)
One can override the default directory that files are copied into using a configmap annotation defined by the environment variable "FOLDER_ANNOTATION" (if not present it will default to "k8s-sidecar-target-directory"). The sidecar will attempt to create directories defined by configmaps if they are not present. Example configmap annotation:
k8s-sidecar-target-directory: "/path/to/target/directory"
If the filename ends with .url suffix, the content will be processed as an URL the target file will be downloaded and used as the content file.
LABEL
LABEL_VALUE
FOLDER
FOLDER_ANNOTATION
NAMESPACE
ALL to search in all namespaces.RESOURCE
METHOD
METHOD is set with LIST, the sidecar will just list config-maps and exit. With SLEEP it will list all config-maps, then sleep for 60 seconds. Default is watch.REQ_URL
REQ_USERNAME
REQ_METHOD
REQ_PAYLOAD
REQ_PASSWORD
REQ_RETRY_TOTAL
REQ_RETRY_CONNECT
REQ_RETRY_READ
REQ_RETRY_BACKOFF_FACTOR
REQ_TIMEOUT
SKIP_TLS_VERIFY
DEFAULT_FILE_MODE
Content type
Image
Digest
Size
41 MB
Last updated
over 6 years ago
docker pull ramsrib/k8s-sidecar