gitcontroller

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

gitcontroller

gitcontroller watches Kubernetes Deployments which use one or more gitRepo volumes and then watches for changes in the associated git repository and branch.

When there are changes in git the gitcontroller will perform a rolling upgrade of the Kubernetes Deployments to use the new configuration git repository revision; or rollback. The rolling upgrade policy (e.g. speed and number of concurrent pods which update and so forth) is all specified by your rolling update configuration in the Deployment specification.

Here is an example of how to add a gitRepo volume to your application; in this case a spring boot application to load the application.properties file from a git repository.

You can either run gitcontroller as a microservice in your namespace or you can use the gitcontroller binary at any time or as part of your CI / CD Pipeline process.

Note we recommend using separate git based configuration repository only for things which truly are environment specific. Its simpler to include all other configuration data with your microservice source code and then use a more regular CI / CD Pipeline from a single git repository to build your code, create the configuration files and package it all into an immutable docker image.

An alternative approach to using a git repository for environmental configuration and gitcontroller is to use ConfigMap such as the ConfigMap PropertySource for spring. On the plus side ConfigMap is supported natively inside Kubernetes; though the downside is ConfigMap has no versioning or history; so once a ConfigMap is changed you've lost track of who changed what and when which makes it harder to track changes.

So if history or tracking changes in your configuration is important we recommend git over ConfigMap.

Using gitcontroller as a command

To use gitcontroller as a command, such as in a CI / CD pipeline download a binary of gitcontroller then use the following command:

gitcontroller check

This will check all Deployments in the current namespace for gitRepo volumes and perform rolling upgrades if they have changed.

You can specify a label selector expression via the --selector command line option which will filter the deployments that are checked.

Using gitcontroller as a microservice

The gitcontroller microservice is now included in the fabric8 release so you can install and run gitcontroller via the fabric8 developer console via the Run... button on the Runtime view or the gofabric8 installer via:

gofabric8 deploy -y --app=gitcontroller --domain=vagrant.f8

You can also run the gitcontroller microservice locally on your machine via the following (adding a --selector selector to filter the deployments watched if you prefer)

gitcontroller run

Development

Prerequisites

Install go version 1.5.1

Building
git clone git@github.com:fabric8io/gitcontroller.git $GOPATH/src/github.com/fabric8io/gitcontroller
./make

Make changes to *.go files, rerun make and run the generated binary..

e.g.

./build/gitcontroller help

Documentation

Overview

*

  • Copyright (C) 2015 Red Hat, Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Directories

Path Synopsis
* * Copyright (C) 2015 Red Hat, Inc.
* * Copyright (C) 2015 Red Hat, Inc.
* * Copyright (C) 2015 Red Hat, Inc.
* * Copyright (C) 2015 Red Hat, Inc.
* * Copyright (C) 2015 Red Hat, Inc.
* * Copyright (C) 2015 Red Hat, Inc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL