Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: EnMasseProject/minikube-setup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: V1.0.0
Choose a base ref
...
head repository: EnMasseProject/minikube-setup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 18, 2020

  1. Update README

    obabec committed Feb 18, 2020
    Copy the full SHA
    4c2c22c View commit details

Commits on Feb 21, 2020

  1. Merge pull request #1 from EnMasseProject/update-readme

    Update README
    obabec authored Feb 21, 2020
    Copy the full SHA
    cecee4d View commit details

Commits on Apr 18, 2020

  1. Update minikube version

    lulf committed Apr 18, 2020
    Copy the full SHA
    40f4477 View commit details
  2. Remove typo

    lulf committed Apr 18, 2020
    Copy the full SHA
    d1a7a3c View commit details
  3. Update version

    lulf committed Apr 18, 2020
    Copy the full SHA
    2d7928a View commit details
  4. Fix package path

    lulf committed Apr 18, 2020
    Copy the full SHA
    37060d6 View commit details
  5. Install minikube dependency

    lulf committed Apr 18, 2020
    Copy the full SHA
    925a088 View commit details

Commits on May 4, 2020

  1. use registry addon

    Fabian Martinez committed May 4, 2020
    Copy the full SHA
    3ef549a View commit details
  2. Merge pull request #2 from famartinrh/registry-addon

    use registry addon
    obabec authored May 4, 2020
    Copy the full SHA
    9114cd2 View commit details
  3. Copy the full SHA
    587aef8 View commit details
  4. Merge pull request #3 from famartinrh/patch-1

    remove insecure registry flag because of registry addon
    kornys authored May 4, 2020
    Copy the full SHA
    9f91dc6 View commit details

Commits on May 5, 2020

  1. back to registry in container

    Fabian Martinez committed May 5, 2020
    Copy the full SHA
    9e48f94 View commit details
  2. Merge pull request #4 from EnMasseProject/fix-master-branch

    back to registry in container
    famarting authored May 5, 2020
    Copy the full SHA
    19ea092 View commit details

Commits on May 6, 2020

  1. set name to registry container

    Fabian Martinez committed May 6, 2020
    Copy the full SHA
    7f7cbab View commit details

Commits on Jun 26, 2020

  1. Copy the full SHA
    2860d2f View commit details
  2. Merge pull request #6 from EnMasseProject/enable-ingress

    Enable ingress addon and SSL passthrough
    Ulf Lilleengen authored Jun 26, 2020
    Copy the full SHA
    c74459a View commit details
  3. Fix kubectl patch

    lulf committed Jun 26, 2020
    Copy the full SHA
    a5c2dca View commit details
  4. Merge pull request #7 from EnMasseProject/fix-kubectl-patch

    Fix kubectl patch
    obabec authored Jun 26, 2020
    Copy the full SHA
    b5ddc3e View commit details

Commits on Nov 18, 2020

  1. Update version of core

    obabec committed Nov 18, 2020
    Copy the full SHA
    e7bb777 View commit details
  2. Merge pull request #9 from EnMasseProject/update-core

    Update core
    obabec authored Nov 18, 2020
    Copy the full SHA
    6ed851a View commit details
  3. Update core

    Change export of env var
    obabec committed Nov 18, 2020
    Copy the full SHA
    1086d24 View commit details
  4. Merge pull request #11 from EnMasseProject/change_export

    Update core
    obabec authored Nov 18, 2020
    Copy the full SHA
    2ac5b39 View commit details
  5. Change RBAC

    obabec committed Nov 18, 2020
    Copy the full SHA
    9741374 View commit details
  6. Merge pull request #12 from EnMasseProject/change-rbac

    Change RBAC
    obabec authored Nov 18, 2020
    Copy the full SHA
    bd08298 View commit details
  7. Copy the full SHA
    fc0f43b View commit details

Commits on Nov 19, 2020

  1. Change starting of minikube

    obabec committed Nov 19, 2020
    Copy the full SHA
    fa644da View commit details
  2. Change variable exporting

    obabec committed Nov 19, 2020
    Copy the full SHA
    4ff8f41 View commit details

Commits on Nov 26, 2020

  1. Fix minikube installation

    obabec committed Nov 26, 2020
    Copy the full SHA
    553b420 View commit details
  2. Upgrade minikube version

    obabec committed Nov 26, 2020
    Copy the full SHA
    8ed981f View commit details
  3. Change patch command

    obabec committed Nov 26, 2020
    Copy the full SHA
    b2fa302 View commit details

Commits on Jan 6, 2021

  1. Copy the full SHA
    53c1e0b View commit details

Commits on Jan 7, 2021

  1. Merge pull request #13 from k-wall/add-reg-always-flag

    Add '--restart=always' to registry
    kornys authored Jan 7, 2021
    Copy the full SHA
    5b25cc8 View commit details
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Minikube setup action

Action installs minikube to hosted VM environment.
Minikube is installed and configured to run on Docker with self hosted registry.

## Registries

Custom registry runs on port 5000.

## Inputs

### `minikube-version`

**Required** Minikube version. Default `"1.4.0"`.
Minikube version. Default `"1.4.0"`.

### `k8s-version`

**Required** Version of Kubernetes you wish to use with Minikube. Default `"1.14.6"`.
Version of Kubernetes you wish to use with Minikube. Default `"1.14.6"`.

## Example usage
```
9 changes: 5 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: 'Minikube setup with registry'
description: 'Installs minikube in Github Actions.'
author: Enmasse Project
description: 'Installs minikube in Github Actions with custom registry.'
branding:
icon: 'cloud'
color: 'blue'
inputs:
minikube-version:
description: 'Minikube version to install'
required: false
default: '1.4.0'
default: '1.15.1'
k8s-version:
description: 'Kubernetes version to install'
required: false
default: '1.15.0'
default: '1.19.0'
outputs:
launcher:
description: 'Command to execute to launch minikube'
runs:
using: 'node12'
main: 'src/index.js'
main: 'src/index.js'
9 changes: 9 additions & 0 deletions node_modules/@actions/core/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 30 additions & 17 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/command.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions node_modules/@actions/core/lib/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 55 additions & 12 deletions node_modules/@actions/core/lib/core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/core.js.map
1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/file-command.d.ts
29 changes: 29 additions & 0 deletions node_modules/@actions/core/lib/file-command.js
1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/file-command.js.map
5 changes: 5 additions & 0 deletions node_modules/@actions/core/lib/utils.d.ts
19 changes: 19 additions & 0 deletions node_modules/@actions/core/lib/utils.js
1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/utils.js.map
32 changes: 17 additions & 15 deletions node_modules/@actions/core/package.json
6 changes: 3 additions & 3 deletions package-lock.json
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -8,16 +8,16 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/CodingNagger/minikube-setup-action.git"
"url": "git+https://github.com/EnMasseProject/minikube-setup.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/CodingNagger/minikube-setup-action/issues"
"url": "https://github.com/EnMasseProject/minikube-setup/issues"
},
"homepage": "https://github.com/CodingNagger/minikube-setup-action#readme",
"homepage": "https://github.com/EnMasseProject/minikube-setup#readme",
"dependencies": {
"@actions/core": "^1.2.0"
"@actions/core": "^1.2.6"
}
}
46 changes: 32 additions & 14 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -7,12 +7,13 @@ const sleep = (milliseconds) => {


function execute_command(command, args) {
core.info(`Run ${command} ${args}`);
var result = spawnSync(command, args);
if(result.status == 0) {
core.info(`${result.stdout.toString()}`);
core.info(`${String(result.stdout)}`);
return 0;
} else {
core.error(`${result.stderr.toString()}`);
core.error(`${String(result.stderr)}`);
return 1;
}
}
@@ -34,44 +35,61 @@ function wait_for_minikube() {
core.setFailed("Minikube failed to start or RBAC could not be properly set up");
}

function install_deps() {
var startCommand = 'sudo';
var startArgs = ['-E', 'apt-get', 'install', 'conntrack'];
return execute_command(startCommand, startArgs);
}

function install_minikube() {
const minikubeVersion = core.getInput('minikube-version');
core.info(`Downloading Minikube...`);
var kubeDownCommand = 'curl';
var kubeDownArgs = ['-LO', `https://storage.googleapis.com/minikube/releases/latest/minikube_${minikubeVersion}.deb`];
var kubeDownArgs = ['-LO', `https://storage.googleapis.com/minikube/releases/latest/minikube_${minikubeVersion}-0_amd64.deb`];
if (execute_command(kubeDownCommand, kubeDownArgs) == 1) return 1;

core.info(`Installing Minikube...`);
var kubeInstallCommand = 'sudo';
var kubeInstallArgs = ['dpkg', '-i', `minikube_${minikubeVersion}.deb`];
var kubeInstallArgs = ['dpkg', '-i', `minikube_${minikubeVersion}-0_amd64.deb`];
return execute_command(kubeInstallCommand, kubeInstallArgs);
}

function run_registry() {
core.info(`Running registry...`);
var registryCommand = 'docker';
var registryArgs = ['run', '-d', '-p', '5000:5000', 'registry'];
var registryArgs = ['run', '--name', 'image-registry', '-d', '-p', '5000:5000', '--restart=always', 'registry'];
return execute_command(registryCommand, registryArgs);
}

function start_minikube() {
const kubernetesVersion = core.getInput('k8s-version');
core.exportVariable('CHANGE_MINIKUBE_NONE_USER', 'true');
var startCommand = 'sudo';
var startArgs = ['-E', 'minikube', 'start', '--vm-driver=none', '--kubernetes-version',
`v${kubernetesVersion}`, '--insecure-registry=localhost:5000', '--extra-config=kubeadm.ignore-preflight-errors=SystemVerification', '--extra-config=apiserver.authorization-mode=RBAC']
core.exportVariable('CHANGE_MINIKUBE_NONE_USER', true);
var startCommand = 'minikube';
var startArgs = ['start', '--vm-driver=docker', '--kubernetes-version',
`v${kubernetesVersion}`, '--extra-config=kubeadm.ignore-preflight-errors=SystemVerification', '--extra-config=apiserver.authorization-mode=RBAC,Node']

if(execute_command(startCommand, startArgs) == 1) return 1;

var addonsCommand = 'sudo';
var addonsArgs = ['-E', 'minikube', 'addons', 'enable', 'default-storageclass'];
return execute_command(addonsCommand, addonsArgs);
var addons = ['default-storageclass', 'ingress'];
for (var i in addons) {
var addon = addons[i];
var addonsCommand = 'sudo';
var addonsArgs = ['-E', 'minikube', 'addons', 'enable', addon];
if (execute_command(addonsCommand, addonsArgs) == 1) return 1;
}


// Enable SSL passthrough support
var ingressCommand = 'kubectl';
var ingressArgs = ['patch', 'deployment', 'ingress-nginx-controller', '-n', 'kube-system', '--type=json', '-p', '[{"op" : "add", "path" : "/spec/template/spec/containers/0/args/-", "value" : "--enable-ssl-passthrough"}]']
return execute_command(ingressCommand, ingressArgs);
}

try {
if (install_minikube() || run_registry() || start_minikube() || wait_for_minikube()) {
if (install_deps() || install_minikube() || run_registry() || start_minikube() || wait_for_minikube()) {
core.setFailed(error.message);
}

} catch (error) {
core.setFailed(error.message);
}
}