Giter VIP home page Giter VIP logo

replicated-starter-kubernetes's Introduction

Replicated Kubernetes Starter

Example project showcasing how power users can combine several Replicated tools in order to manage Replicated YAML using a git repository.

Kubernetes | Swarm

Prequisites

  • node
  • make
  • A git repository created to manage your Replicated YAML. We'll use github in this example.

Get started

First, clone the repo and re-initialize it

git clone github.com/replicatedhq/replicated-starter-kubernetes.git
cd replicated-starter-kubernetes
rm -rf .git
git init
git remote add origin <your git repo>

Configure environment

You'll need to set up two environment variables to interact with vendor.replicated.com, REPLICATED_APP and REPLICATED_API_TOKEN. REPLICATED_APP should be set to the app name in the URL path at https://vendor.replicated.com/apps:

Next, create an API token from the Teams and Tokens page:

Ensure the token has "Write" access or you'll be unable create new releases. Once you have the values, set them in your environment.

export REPLICATED_APP=...
export REPLICATED_API_TOKEN=...

You can ensure this is working with

make deps list-releases

Iterating on your release

Once you've made changes to replicated.yaml, you can push a new release to a channel with

make release channel=Unstable

For an integrated approach, you can use make watch to watch the replicated.yaml file, linting and releasing whenever changes are made.

$ make watch channel=my-dev-channel
: ┌───────────────────────────────────────────
: │ This command will watch replicated.yaml for
: │ changes and publish a new release to the
: │ "my-dev-channel" channel on changes.
: │
: │ You will need to set the following
: │ environment variables, both of which
: │ can be obtained at https://vendor.replicated.com
: │
: │  REPLICATED_APP -- The ID or url slug of your application
: │  REPLICATED_API_TOKEN -- An API token with write access to releases.
: │
: │ You can set the channel by passing a
: │ "channel" to "make watch", e.g.
: │
: │    make watch channel=dev
: │
: └────────────────────────────────────────────
info gazer-color Watching 1 file[s] (replicated.yaml)

Integrating with CI

Often teams will use one channel per developer, and then keep the master branch of this repo in sync with their Unstable branch.

The project includes CI configs for Travis CI and CircleCI.

Both configs will:

On pull requests:

  • Install dependencies
  • Lint yaml for syntax and logic errors

On merges to the github master branch:

  • Install dependencies
  • Lint yaml for syntax and logic errors
  • Create a new release on the Unstable channel in Replicated

These behaviors are documented and demonstrated in the replicated-ci-demo project.

Tools reference

License

MIT

replicated-starter-kubernetes's People

Contributors

dexhorthy avatar

Watchers

 avatar  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.