OpenBudget/budgetkey-k8s

Name: budgetkey-k8s

Owner: ?????? ?? ??????

Description: Budgetkey Kubernetes Environment

Created: 2018-03-26 17:26:27.0

Updated: 2018-05-24 12:16:19.0

Pushed: 2018-05-24 12:16:17.0

Homepage: null

Size: 153

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

The BudgetKey Kubernetes Environment

The Budgetkey Kubernetes environment manages most Budgetkey infrastructure as code.

Interacting with the environment
Prerequisites
Setting up and connecting to the environment
Manage production environments on Google Kubernetes Engine Infrastructure development on Google Kubernetes Engine Local infrastructure development using Minikube
Common Tasks

All code assumes you are inside a bash shell with required dependencies and connected ot the relevant environment

Deployment

Deployments are managed using Helm

Initialize the Helm server side component

ctl create -f rbac-config.yaml
 init --service-account tiller --upgrade --force-upgrade --history-max 2

Deploy all charts (if dry run succeeds)

lm_upgrade_all.sh --install --debug --dry-run && ./helm_upgrade_all.sh --install

You can also upgrade a single chart

lm_upgrade_external_chart.sh  socialmap

The helm_upgrade scripts forward all arguments to the underlying helm upgrade command, some useful arguments:

Adding an external app
Creating a new environment

You can create a new environment by copying an existing environment directory and modifying the values.

See the sk8s environments documentation for more details about environments, namespaces and clusters.

Modifying configuration values

The default values are at values.yaml - these are used in the chart template files (under templates, charts and charts-external directories)

Each environment can override these values using environments/ENVIRONMENT_NAME/values.yaml

Finally, automation scripts write values to values.auto-updated.yaml

Modifying secrets

Secrets are stored and managed directly in kubernetes and are not managed via Helm.

To update an existing secret, delete it first kubectl delete secret SECRET_NAME

After updating a secret you should update the affected deployments, you can use ./force_update.sh to do that

All secrets should be optional so you can run the environment without any secretes and will use default values similar to dev environments.

Each environment may include a script to create the environment secrets under environments/ENVIRONMENT_NAME/secrets.sh - this file is not committed to Git.

You can use the following snippet in the secrets.sh script to check if secret exists before creating it:

bectl describe secret <SECRET_NAME> &&\
bectl create secret generic <SECRET_NAME> <CREATE_SECRET_PARAMS>
Continuous Deployment

Depending on what you intend to do in your continuous deployment script you may need some of the following:

To connect and run commands on a Google Kubernetes Engine environment:

To push changes to GitHub

To build and push docker images


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.