newsdev/kubernetes-secret-env

Name: kubernetes-secret-env

Owner: NYT Newsroom Developers

Description: null

Created: 2016-03-08 20:54:04.0

Updated: 2016-12-29 14:01:40.0

Pushed: 2016-12-29 14:01:39.0

Homepage: null

Size: 3

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Kubernetes Secret Env

Take Kubernetes secrets provided via a mounted volume and execute a process that has environment variables populated from secrets.

kubernetes-secret-env {{ your program }}

Dockerfile

Put this in your Dockerfile to install.

stall kubernetes-secret-env
KUBERNETES_SECRET_ENV_VERSION=0.0.2
\
dir -p /etc/secret-volume && \
 /usr/local/bin && \
rl -fLO https://github.com/newsdev/kubernetes-secret-env/releases/download/$KUBERNETES_SECRET_ENV_VERSION/kubernetes-secret-env && \
d +x kubernetes-secret-env
Releasing new versions

To make the compiled version of kubernetes-secret-env available for Dockerfiles download, we have to separately attach that compiled file to the release on GitHub. This file has to be compiled on the same system architecture that you want it to run on.

On that system, run:

stall golang
get update && apt-get install -y golang vim

py the `kubernetes-secret-env.go` source code to the system
kubernetes-secret-env.go # copy paste

uild

You then need to download the compiled file back to your system to upload it to GitHub. This will depend on what your remote system is.

If it happens to be a Docker container running on Google Kubernetes Engine:

cally
il signurl -p notasecret -c "application/octet-stream" -m PUT [PATH TO PRIVATE KEY] gs://[GCS BUCKET]/kubernetes-secret-env

motely
 -XPUT -H "Content-Type: application/octet-stream" --data-binary @kubernetes-secret-env "[URL FROM ABOVE]"

cally
il cp gs://[GCS BUCKET]/kubernetes-secret-env .

And you've got your file!

Changelog

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.