Code Monkey home page Code Monkey logo

cfgen's People

Contributors

vistrcm avatar zchip avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cfgen's Issues

bug. conf files removed, not disabled.

Looks like service does not disable config files by moving file to <existing_file>.<current_date>.disabled but removes it.

Maybe it is good to make it configurable?

docs. how to get services from another namespace

Need to extend documentation with details how to get services from another namespace.
For example application running in namespace "devops-system" need to generate service configs from namespace "bender".

initial task

High level description of a task

Need to create application which is listening Kubernetes API and creates bunch of nginx configs based on information in Kubernetes API.

Application should get list of services periodically. Compare this list with list of files saved in target directory.

If service exists in k8s API but does not exist in target directory application should create file with the name <service_name>.conf in target directory.
Template of a file:

location /{{.ServiceName}} {
    proxy_pass http://{{.ServiceFQDN}};
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Protocol $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    # next 3 headers added to support websocket
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

If service not presented in k8s API, but corresponding file exist in target directory, move it to file <existing_file>.<current_date>.disabled

<current_date> should be in format yyyyMMddHHmmss. Example: 20190108113405.

ServiceFQDN is A record for the service <service_name>.<namespace>.svc.cluster.local see https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#services for details.

Need to create

  • application itself
  • Dockerfile to build image
  • kubernetes manifest to start
  • short description in README.md

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.