Skip to content

Commit

Permalink
Support for minikube restart (kyma-project#2156)
Browse files Browse the repository at this point in the history
* Support minikube restart

* TW updates

* TW review 2
  • Loading branch information
pbochynski authored and aszecowka committed Jan 10, 2019
1 parent 00ed638 commit b50314c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
23 changes: 22 additions & 1 deletion docs/kyma/docs/030-inst-local-installation-from-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Virtualization:
- [Hyperkit driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#hyperkit-driver) - Mac only
- [VirtualBox](https://www.virtualbox.org/) - Linux only

> **NOTE:** To work with Kyma, use only the provided scripts and commands. Kyma does not work on a basic Minikube cluster that you can start using the `minikube start` command or stop with the `minikube stop` command. If you don't need Kyma on Minikube anymore, remove the cluster with the `minikube delete` command.
> **NOTE:** To work with Kyma, use only the provided scripts and commands. Kyma does not work on a basic Minikube cluster that you can start using the `minikube start` command.
## Set up certificates

Expand Down Expand Up @@ -155,6 +155,27 @@ To enable Horizontal Pod Autoscaler, follow these steps:
minikube addons list
```

## Stop and restart Kyma without reinstalling

Use the `minikube.sh` script to restart the Minikube cluster without reinstalling Kyma. Follow these steps to stop and restart your cluster:

1. Stop the Minikube cluster with Kyma installed. Run:
```
minikube stop
```
2. Restart the cluster without reinstalling Kyma. Run:
```
./scripts/minikube.sh --domain "kyma.local" --vm-driver "hyperkit"
```

The script discovers that a minikube cluster is initialized and asks if you want to delete it. Answering `no` causes the script to start the Minikube cluster and restarts all of the previously installed components. Even though this procedure takes some time, it is faster than a clean installation as you don't download all of the required Docker images.

To verify that the restart is successful, run this command and check if all Pods have the `RUNNING` status:

```
kubectl get pods --all-namespaces
```

## Troubleshooting

If the Installer does not respond as expected, check the installation status using the `is-installed.sh` script with the `--verbose` flag added. Run:
Expand Down
7 changes: 5 additions & 2 deletions docs/kyma/docs/033-inst-local-installation-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ Subsequent sections provide details of all involved subscripts, in the order in

## The minikube.sh script

> **NOTE:** To work with Kyma, use only the provided scripts and commands. Kyma does not work on a basic Minikube cluster that you can start using the `minikube start` command or stop with the `minikube stop` command. If you don't need Kyma on Minikube anymore, remove the cluster with the `minikube delete` command.
> **NOTE:** To work with Kyma, use only the provided scripts and commands. Kyma does not work on a basic Minikube cluster that you can start using the `minikube start` command.
The purpose of the `installation/scripts/minikube.sh` script is to configure and start Minikube. The script also checks if your development environment is configured to handle the Kyma installation. This includes checking Minikube and kubectl versions. If Minikube is already initialized, the system prompts you to agree to remove the previous Minikube cluster. The script exits if you do not want to restart your cluster.
The purpose of the `installation/scripts/minikube.sh` script is to configure and start Minikube. The script also checks if your development environment is configured to handle the Kyma installation. This includes checking Minikube and kubectl versions.
If Minikube is already initialized, the system prompts you to agree to remove the previous Minikube cluster.
- If you plan to perform a clean installation, answer `yes`.
- If you installed Kyma to your Minikube cluster and then stopped the cluster using the `minikube stop` command, answer `no`. This allows you to start the cluster again without reinstalling Kyma.

Minikube is configured to disable the default Nginx Ingress Controller.

Expand Down
4 changes: 0 additions & 4 deletions installation/scripts/minikube.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ function CheckIfMinikubeIsInitialized() {
$cmd = "minikube delete"
Invoke-Expression -Command $cmd
}
else {
Write-Output "Starting minikube cancelled"
exit 1
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions installation/scripts/minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ function checkIfMinikubeIsInitialized() {
read -p "Do you want to remove previous minikube cluster [y/N]: " deleteMinikube
if [ "${deleteMinikube}" == "y" ]; then
minikube delete
else
log "Starting minikube cancelled" red
exit -1
fi
fi
}
Expand Down

0 comments on commit b50314c

Please sign in to comment.