Code Monkey home page Code Monkey logo

pod-dev-syncer's Introduction

pod-dev-syncer

This script is developed to be a tool while developing on a kubernetes cluster.
Certain program languages, like PHP, do not require you to always rebuild the container image.
With this script you can keep an watch job on your development directories and have changes uploaded to your containers automaticly on filesave. This will enable you to rapidly develop a new application without the need to have to wait for image builds.

The container you are syncing to does need to have write rights in the selected locations, you also need to be logged in into the kubernetes cluster.

Requirements

This script requires you to have the following programs installed and in your path:

Usage

Recommended way to use is to make a pod-dev-syncer.yaml in the root of your project and run

/path/to/pod-dev-syncer -C /path/to/project/pod-dev-syncer.yaml

You can use the commandline options, but that is fully at own risk.

Settings file example

---
settings:
  waitTime: 5                           # (optional) Wait time between loop runs, defaults to 5
  tmpLoc: /tmp                          # (optional) Directory to use for temp files, defaults to /tmp
project:
  namespace: "projectx"                 # Name of the namespace/project
  pod: 'web\-[0-9a-f]+\-[0-9a-z]+'      # regex for the pod name, this must be in single quotes to be valid yaml
  container: "php-fpm"                  # Name of the container in the pod
local:
  basedir: "/home/user/projectx/app"    # (optional) base dir of the code, defaults to the dir the configfile is in
  dirs: 
    - src/html:/var/www/html            # format = source:target 
    - src/config:/var/www/config        #   source: based from basedir or absolute path on local filesystem 
    - /opt/shared/libs:/var/www/libs    #   target: has to be absolute path in container

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.