Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconaws-helpers
file-type-iconbuild-helpers
file-type-iconcheck-url
file-type-iconcircleci-helpers
file-type-icondocs-generator
file-type-iconec2-backup
file-type-iconecs-deploy-runner-invoke-iam-policy
file-type-iconecs-deploy-runner-standard-configuration
file-type-iconecs-deploy-runner
file-type-icongit-helpers
file-type-icongruntwork-module-circleci-helpers
file-type-iconiam-policies
file-type-iconinfrastructure-deploy-script
file-type-iconinfrastructure-deployer
file-type-iconinstall-jenkins
file-type-iconjenkins-server
file-type-iconkubernetes-circleci-helpers
file-type-iconbin
file-type-iconREADME.md
file-type-iconinstall.sh
file-type-iconterraform-helpers
file-type-icontest
file-type-icontestdep
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME-CircleCI.adoc
file-type-iconREADME-Jenkins.adoc
file-type-iconREADME-Terraform-Terragrunt-Pipeline.adoc
file-type-iconREADME-TravisCI.adoc
file-type-iconREADME.adoc
file-type-iconsetup.cfg

Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconaws-helpers
file-type-iconbuild-helpers
file-type-iconcheck-url
file-type-iconcircleci-helpers
file-type-icondocs-generator
file-type-iconec2-backup
file-type-iconecs-deploy-runner-invoke-iam-policy
file-type-iconecs-deploy-runner-standard-configuration
file-type-iconecs-deploy-runner
file-type-icongit-helpers
file-type-icongruntwork-module-circleci-helpers
file-type-iconiam-policies
file-type-iconinfrastructure-deploy-script
file-type-iconinfrastructure-deployer
file-type-iconinstall-jenkins
file-type-iconjenkins-server
file-type-iconkubernetes-circleci-helpers
file-type-iconbin
file-type-iconREADME.md
file-type-iconinstall.sh
file-type-iconterraform-helpers
file-type-icontest
file-type-icontestdep
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME-CircleCI.adoc
file-type-iconREADME-Jenkins.adoc
file-type-iconREADME-Terraform-Terragrunt-Pipeline.adoc
file-type-iconREADME-TravisCI.adoc
file-type-iconREADME.adoc
file-type-iconsetup.cfg
EC2 backup

EC2 backup

Snapshot your EC2 instances on a scheduled basis.

Code Preview

Preview the Code

mobile file icon

README.md

down

Kubernetes CircleCI Helpers

This module contains helper scripts that can setup Kubernetes tools for use in a CircleCI job, including:

  • setup-minikube: This script will install and setup minikube in a way that is compatible with CircleCI. In addition, this script will install kubectl, setup to talk to the minikube cluster. Note that this MUST be run on a job that is using the machine executor with the ubuntu 16.04 image (ubuntu-1604:201903-01).

Installing the helpers

You can install the helpers using the Gruntwork Installer:

gruntwork-install --module-name "kubernetes-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "0.0.1"

We recommend running this command in one of the jobs for CircleCI:

job:
  setup:
    # Note: Since minikube uses Docker, we need to run on the machine executor to avoid complications with
    # Docker-in-Docker. Also, minikube requires systemd which is only introduced starting 16.04
    machine:
      enabled: true
      image: "ubuntu-1604:201903-01"
    steps:
      - run:
        command: |
          # Install the Gruntwork Installer
          curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version 0.0.22

          # Use the Gruntwork Installer to install the kubernetes-circleci-helpers module
          gruntwork-install --module-name "kubernetes-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "0.13.12"

Using the setup-minikube helper

The setup-minikube script will do the following:

  1. Mark the root directory as rshared so that it is available to minikube (see https://github.com/kubernetes/kubernetes/issues/61058 for more info).
  2. Install kubectl into /usr/local/bin. You can use the --k8s-version flag to customize the version that is installed. Note that the installed Kubernetes version will also reflect this, so that both kubectl and the available Kubernetes APIs are in sync.
  3. Install minikube into /usr/local/bin. You can use the --minikube-version flag to customize the version that is installed.
  4. Start minikube and wait for it to come up. You can use the --k8s-version flag to configure which version of Kubernetes to run.
  5. Disable the dashboard addon, while enabling the ingress addon so that it is available, and ensure the ingress addon gets deployed correctly.

A few things to note about the way minikube is installed:

  • Disable VM drivers so that it runs directly.
  • RBAC is turned on.
  • The nginx ingress controller is turned on with SSL disabled.
  • The default ServiceAccount in the kube-system namespace inherits cluster admin status.

You can call this as a step in your job:

job:
  setup:
    steps:
      - run:
        command: |
          # Install the Gruntwork Installer
          curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version 0.0.9

          # Use the Gruntwork Installer to install the kubernetes-circleci-helpers module
          gruntwork-install --module-name "kubernetes-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "0.0.5"

      - run:
        command: setup-minikube

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?