Giter Club home page Giter Club logo

dir2cm's Introduction

cmattoon/dir2cm

Build Status

Creates a Kubernetes ConfigMap from a directory. Due to limitations with ConfigMap, only files (not directories) in the first-level directory are processed.

$ mkdir -p configfiles
$ for i in $(seq 1 5); do \
    echo "This is file $i" >> "configfiles/file_${i}.txt"; \
  done
$ dir2cm -dir configfiles -name my-configs

Generates a ConfigMap like so:

---
apiversion: v1
kind: ConfigMap
metadata:
  name: my-configs
  labels: {}
data:
  file_1.txt: |
    This is file 1
  file_2.txt: |
    This is file 2
  file_3.txt: |
    This is file 3
  file_4.txt: |
    This is file 4
  file_5.txt: |
    This is file 5

Docker

Given the setup above, the command

docker run --rm -v "$(pwd)/configfiles:/data" cmattoon/dir2cm -name foobar

Should dump the following to stdout:

apiversion: v1
kind: ConfigMap
metadata:
  name: foobar
  labels: {}
data:
  file_1.txt: |
    This is file 1
  file_2.txt: |
    This is file 2
  file_3.txt: |
    This is file 3
  file_4.txt: |
    This is file 4
  file_5.txt: |
    This is file 5

dir2cm's People

Contributors

cmattoon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wallentx oscni

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.