Giter Site home page Giter Site logo

test-kots's Introduction

Replicated Kubernetes Starter

Example project showcasing how power users can leverage the Replicated CLI Tools to manage kots YAMLs using a git repository.

Get started

This repo is a GitHub Template Repository. You can create a private copy by using the "Use this Template" link in the repo:

Template Repo

You should use the template to create a new private repo in your org, for example mycompany/kots-app or mycompany/replicated-starter-kots.

Once you've created a repository from the template, you'll want to git clone your new repo and cd into it locally.

Install CLI

1. Install CLI

To start, you'll want to install the replicated CLI. You can install with homebrew or grab the latest Linux or macOS version from the replicatedhq/replicated releases page.

Brew
brew install replicatedhq/replicated/cli
Manual
Linux
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
           | grep "browser_download_url.*$(uname | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" \
           | cut -d : -f 2,3 \
           | tr -d \" \
           | cat <( echo -n "url") - \
           | curl -fsSL -K- \
           | tar xvz replicated
Mac
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
           | grep "browser_download_url.*$(uname | tr '[:upper:]' '[:lower:]')_all.tar.gz" \
           | cut -d : -f 2,3 \
           | tr -d \" \
           | cat <( echo -n "url") - \
           | curl -fsSL -K- \
           | tar xvz replicated

Then move ./replicated to somewhere in your PATH:

mv replicated /usr/local/bin/
Verifying

You can verify it's installed with replicated version:

$ replicated version
{
  "version": "0.31.0",
  "git": "c67210a",
  "buildTime": "2020-09-03T18:31:11Z",
  "go": {
      "version": "go1.14.7",
      "compiler": "gc",
      "os": "darwin",
      "arch": "amd64"
  }
}

Configure environment

You'll need to set up two environment variables to interact with vendor.replicated.com:

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

REPLICATED_APP should be set to the app slug from the Settings page:

Next, create a Service Account API token from the vendor portal under Service Accounts:

Ensure the token has the appropriate "Write" access in the selected RBAC policy 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

replicated release ls

Iterating on your release

Once you've made changes to your manifests, lint them with

replicated release lint --yaml-dir=manifests

You can push a new release to a channel with

replicated release create --auto

By default the Unstable channel will be used. You can override this with the --promote flag:

replicated release create --auto --promote=Beta

Integrating with CI

This repo contains a GitHub Actions workflow for ci at ./.github/workflows/main.yml. You'll need to configure secrets for REPLICATED_APP and REPLICATED_API_TOKEN. On every push this will:

  • Ensure a channel exists for the branch that was pushed to
  • Create a release based on the contents of ./manifests

Advanced Usage

Integrating kurl installer yaml

There is a file kurl-installer.yaml that can be used to manage kurl.sh installer versions for an embedded Kubernetes cluster. This will be automatically released in CI. You can create a release manually with

replicated installer create --auto

Tools reference

License

MIT

test-kots's People

Watchers

Kacie Houser 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.