All Projects → doitintl → kuberbs

doitintl / kuberbs

Licence: MIT License
K8s deployment rollback system based on system observability principles of modern stacks

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to kuberbs

Metalk8s
An opinionated Kubernetes distribution with a focus on long-term on-prem deployments
Stars: ✭ 217 (+255.74%)
Mutual labels:  kubernetes-monitoring, kubernetes-deployment
Botkube
An app that helps you monitor your Kubernetes cluster, debug critical deployments & gives recommendations for standard practices
Stars: ✭ 804 (+1218.03%)
Mutual labels:  kubernetes-monitoring, kubernetes-controller
k8s-dt-node-labeller
Kubernetes controller for labelling a node with devicetree properties
Stars: ✭ 17 (-72.13%)
Mutual labels:  kubernetes-deployment, kubernetes-controller
Kubectl Doctor
kubectl cluster triage plugin for k8s - 🏥 (brew doctor equivalent)
Stars: ✭ 209 (+242.62%)
Mutual labels:  kubernetes-monitoring, kubernetes-deployment
multitenant-microservices-demo
Full Isolation in Multi-Tenant SaaS with Kubernetes + Istio
Stars: ✭ 57 (-6.56%)
Mutual labels:  gke, kubernetes-deployment
kubernetes-vault-example
Placeholder for training material related to TA usage of Vault for securing Kubernetes apps.
Stars: ✭ 16 (-73.77%)
Mutual labels:  gke
sentry-k8s
Sentry for Kubernetes
Stars: ✭ 25 (-59.02%)
Mutual labels:  kubernetes-deployment
pipeline-lib
Global shared library for Glia pipeline jobs
Stars: ✭ 68 (+11.48%)
Mutual labels:  kubernetes-deployment
inspec-gke-cis-benchmark
GKE CIS 1.1.0 Benchmark InSpec Profile
Stars: ✭ 27 (-55.74%)
Mutual labels:  gke
datadog-smartmon
DataDog plugin to report hard drive metrics
Stars: ✭ 15 (-75.41%)
Mutual labels:  datadog
auth0-instrumentation
The goal of this package is to make it easier to collect information about our services through logs, metrics and error catching.
Stars: ✭ 18 (-70.49%)
Mutual labels:  datadog
spring-boot-microservice-best-practices
Best practices and integrations available for Spring Boot based Microservice in a single repository.
Stars: ✭ 139 (+127.87%)
Mutual labels:  kubernetes-deployment
kubernetes
Kubernetes Course
Stars: ✭ 19 (-68.85%)
Mutual labels:  kubernetes-deployment
aws-iam-operator
AWS IAM Operator for Kubernetes
Stars: ✭ 23 (-62.3%)
Mutual labels:  kubernetes-controller
build-your-own-platform-with-knative
Knativeのコンポーネントを理解しながらFaaSプラットフォームをDIYするワークショップです
Stars: ✭ 43 (-29.51%)
Mutual labels:  gke
dog-statsd
🐶 DataDog StatsD Client
Stars: ✭ 38 (-37.7%)
Mutual labels:  datadog
scaladog
Datadog API client for Scala.
Stars: ✭ 29 (-52.46%)
Mutual labels:  datadog
gke-managed-certificates-demo
GKE ingress with GCP managed certificates
Stars: ✭ 21 (-65.57%)
Mutual labels:  gke
atlassian-kubernetes
All things Atlassian and Kubernetes
Stars: ✭ 30 (-50.82%)
Mutual labels:  gke
k8s-healthcheck
A simple app that returns the health statuses of the Kubernetes control-plane components, cluster nodes and deployments
Stars: ✭ 23 (-62.3%)
Mutual labels:  kubernetes-monitoring

kuberbs

K8 deployment automatic rollback system

License GitHub stars Build Status

Blog post

Deploy kuberbs (without building from source)

If you just want to use KubeRBS (instead of building it from source yourself), please follow instructions in this section. You need a Kubernetes 1.10 or newer cluster. You can install Kuberbs on any Kubernetes cluster either on perm or in the cloud. Kuberbs supports metrics from DataDog or Stackdriver

GKE Specific Setup

You'll also need the Google Cloud SDK. You can install the Google Cloud SDK (which also installs kubectl) here.

Configure gcloud sdk by setting your default project:

gcloud config set project {your project_id}

Set the environment variables:

export GCP_REGION=us-central1
export GKE_CLUSTER_NAME=kuberbs-cluster
export PROJECT_ID=$(gcloud config list --format 'value(core.project)')

Create IAM Service Account and obtain the Key in JSON format

Create Service Account with this command:

gcloud iam service-accounts create kuberbs-service-account --display-name "kuberbs"

Create and attach custom kuberbs role to the service account by running the following commands:

gcloud iam roles create kuberbs --project $PROJECT_ID --file roles.yaml

gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:kuberbs-service-account@$PROJECT_ID.iam.gserviceaccount.com --role projects/$PROJECT_ID/roles/kuberbs

Generate the Key using the following command:

gcloud iam service-accounts keys create key.json \
--iam-account kuberbs-service-account@$PROJECT_ID.iam.gserviceaccount.com

Create Kubernetes Secret

Get your GKE cluster credentials with (replace cluster_name with your real GKE cluster name):

gcloud container clusters get-credentials $GKE_CLUSTER_NAME
--region $GCP_REGION
--project $PROJECT_ID

None GKE Specific Setup

Create a Kubernetes secret by running:

kubectl create secret generic kuberbs-key --from-file=key.json --namespace=kube-system

Deploy Kuberbs

kubectl apply -f deploy/.

Create Configuration file

Change the example in examples\kuberbs-example.yaml to fit your needs

Here are the configuration options

watchperiod int - for how long to watch a deployment

metricssource string - currently we support stackdriver and datadog

for each namespace that you would like to watch you can have multiple deployments. Each deployments must have a name, a metric and the threshold per second.

Deploy your configuration file.

Deploy & Build From Source

You need a Kubernetes 1.10 or newer cluster. You also need Docker and kubectl 1.10.x or newer installed on your machine, as well as the Google Cloud SDK. You can install the Google Cloud SDK (which also installs kubectl) here.

Clone Git Repository

Make sure your $GOPATH is configured. You'll need to clone this repository to your $GOPATH/src folder.

git clone https://github.com/doitintl/kuberbs.git $GOPATH/src/kuberbs
cd $GOPATH/src/kuberbs 

Build kubeRBS's container image

Install go/dep (Go dependency management tool) using these instructions and then run

dep ensure

You can now compile the kuberbs binary and run tests

make

Build kuberbs's container image

Compile the kuberbs binary and build the Docker image as following:

make image

Tag the image using:

docker tag kuberbs gcr.io/$PROJECT_ID/kuberbs

Finally, push the image to Container Registry with:

For example

docker push gcr.io/$PROJECT_ID/kuberbs

GKE Specific Setup

Set Environment Variables

Replace us-central1 with the region where your GKE cluster resides and kuberbs-cluster with your real GKE cluster name

export GCP_REGION=us-central1
export GKE_CLUSTER_NAME=kuberbs-cluster
export PROJECT_ID=$(gcloud config list --format 'value(core.project)')

Create IAM Service Account and obtain the Key in JSON format

Create Service Account with this command:

gcloud iam service-accounts create kuberbs-service-account --display-name "kuberbs"

Create and attach custom kuberbs role to the service account by running the following commands:

gcloud iam roles create kuberbs --project $PROJECT_ID --file roles.yaml

gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:kuberbs-service-account@$PROJECT_ID.iam.gserviceaccount.com --role projects/$PROJECT_ID/roles/kuberbs

Generate the Key using the following command:

gcloud iam service-accounts keys create key.json \
--iam-account kuberbs-service-account@$PROJECT_ID.iam.gserviceaccount.com

Create Kubernetes Secret

Get your GKE cluster credentials with (replace cluster_name with your real GKE cluster name):

gcloud container clusters get-credentials $GKE_CLUSTER_NAME
--region $GCP_REGION
--project $PROJECT_ID

None GKE Specific Setup

Create a Kubernetes secret by running:

kubectl create secret generic kuberbs-key --from-file=key.json --namespace=kube-system

Deploy kuberbs by running

kubectl apply -f deploy/.

Running kuberbs locally

Make sure you can access your cluster

APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ")

TOKEN=$(kubectl describe secret $(kubectl get secrets | grep ^default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d " ")

curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure

If you can access your cluster then you need to set up the credentials:

echo $TOKEN >token tr -d '\n' <token >t sudo cp t /var/run/secrets/kubernetes.io/serviceaccount/token ssh into one of the containers in your cluster and get /var/run/secrets/kubernetes.io/serviceaccount/ca.crt. copy that file to your local /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

In the file pkg/clinetset/v1/rbs replace const RbsNameSpace = "kube-system" with const RbsNameSpace = "default"

References:

Event listening code was taken from kubewatch

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].