Code Monkey home page Code Monkey logo

deployment-configs's Introduction

Kubernetes configs for canonical websites

This repository contains the configuration files the Kubernetes deployments for some of our websites.

We are using jinja2 as a template system for our configurations. All the template values for our projects can be found under the sites folder.

Structure

We deploy our services into one of two namespaces:

  • staging: Services for our staging servers (there's usually one per production website)
  • production: Services for our production servers

Template system

All configurations for our projects can be found under the sites folder. Using the konf.py script, we generate the following Kubernetes objects:

  • service
  • deployment
  • ingress

E.g.:

./konf.py staging sites/canonical.com.yaml

Deploying

Using create-project

When creating a new project, you can either copy an existing projects values file and modify the file as you want. Here is a document explaining all the possibles values:

Or use ./create-project. To auto-generate the files for a new project. Run ./create-project project.name and the tool will create the config files for you.

For example: ./create-project new-site.com

Will create:

  • /sites/new-site.com.yaml

To deploy a new service

E.g. to deploy the snapcraft.io service to staging from scratch:

# E.g. To deploy the snapcraft.io services to staging
./konf.py staging sites/snapcraft.io.yaml | kubectl apply --filename -

E.g. to deploy a specific docker image

# E.g. To deploy the snapcraft.io services to staging
./konf.py staging sites/snapcraft.io.yaml --tag a264efb326485 | kubectl apply --filename -

To update an existing service

Or to update an existing snapcraft.io service without changing the deployed image:

# E.g. for snapcraft.io
TAG_TO_DEPLOY=$(kubectl get deployment snapcraft-io --namespace staging -o jsonpath="{.spec.template.spec.containers[*].image}" | grep -P -o '(?<=:)[^:]*$')

./konf.py staging sites/snapcraft.io.yaml --tag $TAG_TO_DEPLOY | kubectl apply --filename -

deployment-configs's People

Contributors

anthonydillon avatar b-m-f avatar bartaz avatar carkod avatar hatched avatar jkfran avatar jpmartinspt avatar lukewh avatar nottrobin avatar renovate-bot avatar solazio avatar squidsoup avatar steverydz avatar tbille avatar willmoggridge 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.