🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

github.com/belimawr/kubernetes-envvar

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/belimawr/kubernetes-envvar

Source
Go
Version
v0.0.0-20171225175212-e8561cc0e8c2
Version published
Created
Source

Kubernetes-envvar

Build Status Coverage Status GoDoc Go Report Card

Small cli application to read environment variables from Kubernetes' deployment.yaml, export them and run a command in the "new" environment

This is a WORK IN PROGRESS!!!

Motivation

I've been using Kubernetes for a while now and using environment variables to configure my applications and each environment (staging, production, etc) has got its own deployment.yaml and when the number of environment variables grows past two it gets annoying to run an application locally pointing to a different environment (e.g. staging).

So I decided to write this wee tool to do the "monkey job" of reading the deployment.yaml and exporting the environment variables

Usage

$ ./kubernetes-envvar <type: d|t> <filepath> <command and args>

Arguments:

  • Type: It's either t or d depending on the structure of the yaml file.
  • Filepath: Is the path to the Kubernetes' deployment.yaml
  • Command: Is the command and it's args.

TODO

  • Remove ugly workaround helm templates
  • Parse/replace environment variables on the command and it's arguments
  • Parse deployment.yaml in a more generic way
  • Review the logging/debug messages
  • Return the return code of the command run

Licence

GPLv3

FAQs

Package last updated on 25 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts