GithubHelp home page GithubHelp logo

lowdefy-example-k8s's Introduction

lowdefy-example-k8s

A set of YAMLs to deploy a Lowdefy application on Kubernetes (FOR NOW WORKS WITH NODEPORT ONLY)

tested on -> minikube v1.20.0 on Ubuntu 20.04 OS

To do a simple deployment -

  • use yamls from config-simple-deploy folder

If you want to use "git" to get your build files, you can choose either of the options -

  • git-init -> pulls build files from git repo when the container starts
    • use yamls from config-git-init folder
  • git-sync -> keeps syncing build dir from git repo at regular intervals
    • use yamls from config-git-sync/README.md folder

If you want to use a persistent volume -

  • use yamls from config-by-pv folder

Other options will be updated soon


How to use?

  • clone this repo
  • modify yamls as needed
  • set KUBECONFIG to map to your relevant cluser/namespace
  • then use the command kubectl apply -f .

Regardless of which of the above configs you are using, here is a very generic explaination about the files included -

deploy.yaml

  • this file is responsible for creating a Kubernetes object called "Deployment"
  • it contains spec (defination) for pods
  • each pod spec defines what containers are a part of that pod, if there are any initContainers etc.
  • under container section we can alter the env variables, config paths etc.
  • in case of git-init/git-sync configs a volume local to pod is defined and shared between these containers.

pv.yaml

This is the file which is used to create PersistentVolume. this will work only if your host has build files available in "/data/lowdefy/build/" and if your k8s is running on that node. If you are running a multinode cluster, please modify this to local/nfs The storageclass tells k8s how you want to provision a PV for your cluster/namespace/usecase. It depends on your infra/cluster . please refer this link for more information and this

svc.yaml

  • While we use deploy.yaml to deploy the application, inorder to expose it to external world, kubernetes allows us to either use ingress or to use NodePort.
  • While serving Lowdefy from ingress there were some errors observed hence, for now, this repo only allows exposing Lowdefy from NodePort.
  • svc.yaml makes a LoadBalancer and maps it to containerPort.
  • NodePort here can be customized/altered as per your cluster

lowdefy-gitsync-configmap.yaml

This file is available only in git-init/git-sync folders -

  • this file contains all the git related configurations which are made as a k8s ConfigMap and then loaded as env variables
  • you can specify your git repository in place of the value specified agaisnt GIT_SYNC_REPO
  • you can specify the sync time/interval in the value specified against GIT_SYNC_TIMEOUT
  • for a initContainer it is best to specify GIT_SYNC_ONE_TIME
  • if your repo is public, no need to specify GIT_SYNC_USERNAME, you may remove that line entirely or just specify ""
  • However, the password/token is mentioned as a secret.
  • to customize further and to understand GIT_SYNC sidecar please refer to [this link] (https://github.com/kubernetes/git-sync)

lowdefy-git-secrets.yaml

This file is available only in git-init/git-sync folders -

  • the password/token to clone git repo can be stored as a k8s secret and mounted only on the git-sync container as an env variable

lowdefy-example-k8s's People

Contributors

vaddisrinivas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.