Skip to content

Latest commit

 

History

History
145 lines (95 loc) · 4.08 KB

README-old.md

File metadata and controls

145 lines (95 loc) · 4.08 KB

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

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

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