Skip to content

saltstack-formulas/kubernetes-formula

Repository files navigation

kubernetes-formula

Extensible formula to install kubernetes on MacOS, Windows, and GNU/Linux. Support for:

The default kubernetes.sigs state includes the following:

The default kubernetes.devtools state includes the following:

The default kubernetes.operator state includes:

The default kubernetes.operators state [all OS] includes (from https://operatorhub.io):

The default kubernetes.devlibs state includes [all OS]:

The default kubernetes.crimgr state includes (linux):

Travis CI Build Status Semantic Release

A SaltStack formula for kubernetes on MacOS, GNU/Linux and Windows.

Table of Contents

General notes

See the full SaltStack Formulas installation and usage instructions. If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section. If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning. See Formula Versioning Section for more details.

Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

Available Meta states

kubernetes

Meta-state (This is a state that includes other states).

This state installs the kubernetes solution (see https://kubernetes.io)

kubernetes.clean

Meta-state (This is a state that includes other states).

This state removes the kubernetes solution.

kubernetes.package.repo

This state installs kubernetes package repository only (see https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-using-native-package-management)

kubernetes.package.repo.clean

This state removes kubernetes package repository only.

kubernetes.client

This state installs kubernetes cli and libraries only (see https://kubernetes.io/docs/reference/kubectl, (https://kubernetes.io/docs/setup/release/notes/#client-binaries, and https://kubernetes.io/docs/reference/using-api/client-libraries)

kubernetes.client.clean

This state uninstalls kubernetes cli and libraries only.

kubernetes.server

This state installs kubernetes server GNU/Linux only (see https://kubernetes.io and https://kubernetes.io/docs/setup/release/notes/#server-binaries)

kubernetes.server.clean

This state uninstalls kubernetes server GNU/Linux only.

kubernetes.node

This state installs kubernetes node on Windows/MacOS/Linux only (see https://kubernetes.io/docs/concepts/architecture/nodes)

kubernetes.node.clean

This state uninstalls kubernetes node on Windows/MacOS/Linux only.

kubernetes.sigs

This state installs kubernetes sig archives only

kubernetes.sigs.clean

This state uninstalls kubernetes sig archives only

kubernetes.operator

This state installs operator archives only (Linux/MacOS)

kubernetes.operator.clean

This state uninstalls operator archives only (Linux/MacOS)

kubernetes.operators

This state installs operator archives only

kubernetes.operators.clean

This state uninstalls operator archives only

kubernetes.devtools

This state installs selected kubernetes developer tools only

kubernetes.devtools.clean

This state uninstalls selected kubernetes developer tools only

kubernetes.devlibs

This state installs selected kubernetes developer libraries

kubernetes.devlibs.clean

This state uninstalls selected kubernetes developer libraries (i.e. kubernetes client libraries, kopf, etc).

kubernetes.crimgr

This state installs kubernetes cri-resource-manager

kubernetes.crimgr.clean

This state uninstalls kubernetes cri-resource-manager

Main Sub-states

This list may be incomplete.

kubernetes.server.package

This state installs server packages from repo.

kubernetes.server.package.clean

This state uninstalls server packages only

kubernetes.server.archive

This state installs server archive only

kubernetes.server.archive.clean

This state uninstalls server archive only

kubernetes.node.package

This state installs node packages from repo.

kubernetes.node.package.clean

This state uninstalls node packages only

kubernetes.node.archive

This state installs node archive only

kubernetes.node.archive.clean

This state uninstalls node archive only

kubernetes.client.package

This state installs kubectl package only from repo.

kubernetes.client.aliases

This state installs kubernetes developer aliases to /etc/defaults.

kubernetes.client.package.clean

This state uninstalls kubectl package only

kubernetes.client.archive

This state installs kubectl archive only

kubernetes.client.archive.clean

This state uninstalls kubectl archive only

kubernetes.client.binary

This state installs kubectl binary only

kubernetes.client.binary.clean

This state uninstalls kubectl binary only

kubernetes.k3s.binary

This state installs k3s binary only

kubernetes.k3s.binary.clean

This state uninstalls k3s binary only

kubernetes.k3s.script

This state installs k3s script only

kubernetes.k3s.script.clean

This state uninstalls k3s script only

Testing

Linux testing is done with kitchen-salt.

Requirements

  • Ruby
  • Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

bin/kitchen converge

Creates the docker instance and runs the kubernetes main state, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the docker instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you SSH access to the instance for manual testing.