Giter VIP home page Giter VIP logo

kubectl-ran's Introduction

kubectl-ran

A Kubernetes addon for running an ephemeral container with a "mounted" volume.

Example:

mkdir -p ./stuff
echo "Test suite" > ./stuff/in.txt
kubectl ran busybox -e VAR1=Hello -e VAR2=world -v ./stuff:/stuff -- sh -c 'cp /stuff/in.txt /stuff/out.txt && echo "$VAR1 $VAR2" >> /stuff/out.txt'
cat ./stuff/out.txt

It works by

  1. Starting a container with tail -f /dev/null in a new pod. You can optionally specify environment variables.
  2. Copies any "mounted" volumes into the container.
  3. Runs the specified command.
  4. Copies the "mounted" volumes back out of the container.
  5. Deletes the pod.

Requires the image contain tail and tar.

You can provide a file with --pod-file pod.yaml to specify additional options for the pod or add a sidecar, as in

spec:
  containers:
  - name: selenium
    image: selenium/standalone-chrome
    ports:
    - name: selenium
      containerPort: 4444
    readinessProbe:
      httpGet:
        path: /
        port: 4444
    volumeMounts:
    - mountPath: /dev/shm
      name: dshm
  volumes:
  - name: dshm
    emptyDir:
    medium: Memory

kubectl-ran's People

Contributors

abottchen avatar mikaelsmith avatar

Watchers

 avatar

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.