Installing Che on Minikube
This article explains how to create a single-node Kubernetes cluster with Minikube to deploy Che.
Remember that single-node Kubernetes clusters are suited only for testing or single-user development. Do NOT use such clusters to run Che for organizations or developer teams. |
Using Minikube to set up Kubernetes
This section describes how to use Minikube to set up a local single-node Kubernetes cluster.
-
An installation of
kubectl
. See Installing and Setting Up kubectl . -
An installation of Minikube with Kubernetes version
1.9
or higher. See Installing Minikube.
-
Start Minikube (it is important to allocate at least 4GB of RAM but 8GB are recommended):
$ minikube start --addons=ingress --vm=true --memory=8192
Installing Che on Minikube using chectl
This section describes how to install Che on Minikube using chectl.
-
The
chectl
management tool is available. See Using the chectl management tool. -
A running instance of Minikube. See Using Minikube to set up Kubernetes.
-
Run the following command:
$ chectl server:deploy --platform minikube
Add option --installer helm to use the helm chart and install a single-user instance of Che.
|
Importing certificates to browsers
This section describes how to import a root certificate authority into a web browser to use Che with self-signed TLS certificates.
When a TLS certificate is not trusted, the error message "Your Eclipse Che server may be using a self-signed certificate. To resolve the issue, import the server CA certificate in the browser." blocks the login process. To prevent this, add the public part of the self-signed CA certificate into the browser after installing Che.
Adding certificates to Google Chrome on Linux or Windows
-
Navigate to URL where Che is deployed.
-
Save the certificate:
-
Click the warning or open lock icon on the left of the address bar.
-
Click Certificates and navigate to the Details tab.
-
Select the top-level certificate which is the Root certificate authority and export it:
-
On Linux, click the Export button.
-
On Windows, click the Save to file button.
-
-
-
Go to Google Chrome Settings, then to the Authorities tab
-
In the left panel, select Advanced and continue to Privacy and security.
-
At the center of the screen, click Manage certificates and navigate to Authorities tab.
-
Click the Import button and open the saved certificate file.
-
Select Trust this certificate for identifying websites and click the OK button.
-
After adding the Che certificate to the browser, the address bar displays the closed lock icon next to the URL, indicating a secure connection.
Adding certificates to Google Chrome and Safari on macOS
-
Navigate to URL where Che is deployed.
-
Save the certificate:
-
Click the lock icon on the left of the address bar.
-
Click Certificates.
-
Select the certificate to use and drag and drop its displayed large icon to the desktop.
-
-
Open the Keychain Access application.
-
Select the System keychain and drag and drop the saved certificate file to it.
-
Double-click the imported CA, then go to Trust and select When using this certificate: Always Trust.
-
Restart the browser for the added certificated to take effect.
Adding certificates to Firefox
-
Navigate to URL where Che is deployed.
-
Save the certificate:
-
Click the lock icon on the left of the address bar.
-
Click the > button next to the Connection not secure warning.
-
Click the More information button.
-
Click the View Certificate button on the Security tab.
-
Select the second certificate tab. The certificate Common Name should start with ingress-operator
-
Click the PEM (cert) link and save the certificate.
-
-
Navigate to about:preferences, search for
certificates
, and click View Certificates. -
Go to the Authorities tab, click the Import button, and open the saved certificate file.
-
Check Trust this CA to identify websites and click OK.
-
Restart Firefox for the added certificated to take effect.
-
After adding the Che certificate to the browser, the address bar displays the closed lock icon next to the URL, indicating a secure connection.
Running Minikube inside an LXC container
This section describes how to properly configure an LXC container to set up Minikube when the hypervisor uses ZFS, Btrfs, or LVM to provision the containers storage.
Background
The Problem
According to Docker storage drivers, the Docker overlay2 driver is only supported with the Ext4 and XFS file systems (with Solution
create a virtual block device inside a volume, which in the case of Btrfs is impossible and requires to use a file as the virtual block device. |
In the following instructions, change the zfsPool
or LVM volume_group
name and dockerstorage
according to your use case and preferences.
-
Create a fixed size ZFS dataset or LVM volume on the hypervisor side:
$ zfs create -V 50G zfsPool/dockerstorage #USING ZFS $ lvcreate -L 50G -n dockerstorage volumegroup_name #USING LVM
-
Use a partition tool to create a partition inside the virtual block device:
$ parted /dev/zvol/zfsPool/dockerstorage --script mklabel gpt #USING ZFS $ parted /dev/zvol/zfsPool/dockerstorage --script mkpart primary 1 100% #USING ZFS $ parted /dev/mapper/volumegroup_name-dockerstorage --script mklabel gpt #USING LVM $ parted /dev/mapper/volumegroup_name-dockerstorage --script mkpart primary 1 100% #USING LVM
There is now a reference called:
-
For ZFS:
dockerstorage-part1
inside the/dev/zvol/zfsPool
directory -
For LVM:
volumegroup_name-dockerstorage1
inside the/dev/mapper
directoryThis is the partition of the virtual block device to be used to store
/var/lib/docker
from the LXC container.
-
-
Format the virtual partition to XFS with the
ftype
flag set to1
:$ mkfs.xfs -n ftype=1 /dev/zvol/zfsPool/dockerstorage-part1 #FOR ZFS $ mkfs.xfs -n ftype=1 /dev/mapper/volumegroup_name-dockerstorage1 #FOR LVM
-
Attach the virtual partition to the container (
minikube
is the name of the LXC container,dockerstorage
is the name for the storage instance in LXC configuration):$ lxc config device add minikube dockerstorage disk path=/var/lib/docker \ source=/dev/zvol/zfsPool/dockerstorage-part1 #FOR ZFS $ lxc config device add minikube dockerstorage disk path=/var/lib/docker \ source=/dev/mapper/volumegroup_name-dockerstorage1 #FOR LVM
Check the filesystem inside the container using the
df
command:$ df -T /var/lib/docker
-
Use the following LXC configuration profile in the LXC container to allow it to run Minikube:
config: linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter raw.lxc: | lxc.apparmor.profile=unconfined lxc.mount.auto=proc:rw sys:rw lxc.cgroup.devices.allow=a lxc.cap.drop= security.nesting: "true" security.privileged: "true" description: Profile supporting minikube in containers devices: aadisable: path: /sys/module/apparmor/parameters/enabled source: /dev/null type: disk aadisable2: path: /sys/module/nf_conntrack/parameters/hashsize source: /sys/module/nf_conntrack/parameters/hashsize type: disk aadisable3: path: /dev/kmsg source: /dev/kmsg type: disk name: minikube
-
After starting and setting up networking and the Docker service inside the container, start Minikube:
$ minikube start --vm-driver=none --extra-config kubeadm.ignore-preflight-errors=SystemVerification