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

Commit

Permalink
Added Homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
tonikautto committed Aug 9, 2019
1 parent d54f86a commit e26770c
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 26 deletions.
15 changes: 15 additions & 0 deletions 0-Install-Tools-Chocolatey-Win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#Requires -RunAsAdministrator

# Virtual box
choco install virtualbox --force --yes

# Minikube
choco install minikube --force --yes

# Kubectl
choco install kubernetes-cli --force --yes

# Helm
# choco install kubernetes-helm --yes
# Workaround due to issues with Helm 2.14, https://support.qlik.com/articles/000075385
choco install kubernetes-helm --version 2.13.1 --yes --force
16 changes: 16 additions & 0 deletions 0-Install-Tools-Homebrew-Mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Update Homebrew
brew update

# Virtual box
brew cask install virtualbox

# Minikube
brew cask install minikube

# Kubectl
brew install kubernetes-cli

# Helm
brew install kubernetes-helm
8 changes: 7 additions & 1 deletion 1-Deploy-Minikube.ps1 → 1-Deploy-Minikube-Win.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start minikube with 2 CPU and 8GB RAM
minikube start --memory 8000 --cpus=2
minikube start --memory 8000 --cpus=4

# Force Kubectl to poin to minikube
kubectl config set-cluster minikube
Expand All @@ -15,3 +15,9 @@ helm install --name qliksense-init qlik/qliksense-init

# Install the Qlik Sense package
helm install -n qliksense qlik/qliksense -f values.yaml

# List pods
kubectl get pods

# Print IP
minikube ip
25 changes: 25 additions & 0 deletions 1-Deploy-Minikube.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Start minikube with 2 CPU and 8GB RAM
minikube start --memory 8000 --cpus=4

# Force Kubectl to poin to minikube
kubectl config set-cluster minikube

# Run the following command to add Qlik’s helm chart repository to Helm. This is where Qlik Sense is pulled from:
helm repo add qlik https://qlik.bintray.com/stable

# use helm to deploy into Kubernetes, the helm Tiller pod is added to the Kubernetes cluster first.
helm init --wait

# Install custom resource definitions used by dynamic engines
helm install --name qliksense-init qlik/qliksense-init

# Install the Qlik Sense package
helm install -n qliksense qlik/qliksense -f values.yaml

# List pods
kubectl get pods

# Print IP
minikube ip
100 changes: 75 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

This project simplifies the deployment of Qlik Sense Enterprise for Kubernetes (QSEoK) on local Minikube. This can be used for testing, but should not be applied in production environment.

Scripts and details are based on default deployment of Qlik Sense April 2019 in a Windows client machine.

## Qlik Sense Help Reference
Scripts and details are based on default deployment of Qlik Sense April 2019 as described in related Qlik Help pages.

* [Qlik Sense Help](https://help.qlik.com/en-US/sense/Content/Sense_Helpsites/Home.htm)
* [Qlik Sense Enterprise on Kubernetes](https://help.qlik.com/en-US/sense/April2019/Subsystems/PlanningQlikSenseDeployments/Content/Sense_Deployment/Deploying-Qlik-Sense-multi-cloud-Efe.htm)
Expand All @@ -15,37 +13,89 @@ Scripts and details are based on default deployment of Qlik Sense April 2019 in
## Pre-requisites

- Qlik Sense Enterprise signed license key
- Windows client machine
- Tools to run and envrionemtn
- Package manager installed
- Windows: [Install Chocolatey](https://chocolatey.org/install)
- MacOS: [Install Homebrew](https://brew.sh/)
- Tools to run and envrionment
- Virtualbox
- Minikube
- Kubectl
- Helm
- Internet access

## Before you begin

Check that virtualization is enabled on your client machine.

### Windows

Run `systeminfo` command in Powershell to confirm if virtualization is enabled on your computer.
If you see the following output, virtualization is supported on Windows.
If you do not get below details, please enable virtualization (VT-x feature) in BIOS settings.
```
Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes
```

### MacOS

Run the following command in terminal to confirm if virtualization is supported on macOS.
<br/>`sysctl -a | grep machdep.cpu.features`
<br/>If you see VMX in the output, the VT-x feature is supported on your OS.

## Install Tools
Tools only need to be installed once, and only if not already installed. Below references use [Chocolatey package manager for Windows](https://chocolatey.org/) as an easy way to silently install the required tools.

1. Open PowerShell terminal as Administrator
1. Install Chocolatey package manager
```
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```
1. Install tool packages from Chocolatey
- Virtualbox `choco install virtualbox --yes`
- Minikube `choco install minikube --yes`
- Kubectl `choco install kubernetes-cli --yes`
- Helm `choco install kubernetes-helm --yes`
1. Restart computer to complete installations
Tools only need to be installed once, and only if not already installed.

Below references use [Chocolatey package manager for Windows](https://chocolatey.org/) or [Homebrew package manager for MacOS](https://brew.sh/).

1. Open terminal
- Windows: PowerShell terminal as Administrator
- MacOS: Terminal
1. Install tool packages
- Windows
- Virtualbox: `choco install virtualbox --force --yes`
- Minikube: `choco install minikube --force --yes`
- Kubectl: `choco install kubernetes-cli --force --yes`
- Helm: `choco install kubernetes-helm --force --yes`
- MacOS
- Virtualbox: `brew cask install virtualbox`
- Minikube: `brew cask install minikube`
- Kubectl: `brew install kubernetes-cli`
- Helm: `brew install kubernetes-helm`
1. Open Virtualbox GUI to confirm it was instaleld correctly
1. Open tools help to confirm successful install
- Minikube `minikube --help`
- Kubectl `kubectl --help`
- Helm `helm --help`

## Deploy Qlik Sense on Kubernetes on Minikube

1. Open Powershell terminal
1. Run `1-Deploy-Minikube.ps1` to deploy QSEoK on Minikube
- Runs Minikube VM in Virtual box
- Installs and configures QSE on Kubernetes
1. Run `kubectl get pods` until all pods are running. <br/>Note, this takes several minutes.
1. Get Minikube IP address `minikube ip`
1. Update Windows hostfile in *C:\Windows\System32\drivers\etc* to include row with IP from previous refering to *elastic.example* <br /> `<IP ADDRESS> elastic.example`
1. Open Powershell (Run as Administrator) in Windows _or_ Terminal in MacOS
1. Start Minikube
`minikube start --memory 8000 --cpus=4`
<br/>Note: Set the kube size so it fits within available resources
1. Configure Kubesctl to target Minikube
`kubectl config set-cluster minikube`
1. Add Qlik's chart repository to Helm
`helm repo add qlik https://qlik.bintray.com/stable`
1. Initiate Helm for deployment into Kubernetes. Helm Tiller pod is added to the Kubernetes cluster first.
`helm init --wait`
1. Install custom resource definitions used by dynamic engines
`helm install --name qliksense-init qlik/qliksense-init`
1. Install the Qlik Sense packages
`helm install -n qliksense qlik/qliksense -f values.yaml`
1. List pods to see their current status
`kubectl get pods`
1. Repeat previous step until all pods (besides engine) are running.
<br/>Note, this takes several minutes.
1. Get Minikube IP address
`minikube ip`
1. Update local host file to enable resolving Minikube IP to *elastic.example*.
<br/>Windows: *C:\Windows\System32\drivers\etc\hosts*
<br/>MacOS:
Windows hostfile in *C:\Windows\System32\drivers\etc* to include row with IP from previous refering to *elastic.example* <br /> `<IP ADDRESS> elastic.example`
1. Browse to console https://elastic.example:32443/console/
1. Apply license
1. Browse to Hub https://elastic.example:32443
Expand Down
13 changes: 13 additions & 0 deletions hostfile.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Uncomment lines with localhost on them:
$hostsPath = "$env:windir\System32\drivers\etc\hosts"
$hostsPath
$hosts = get-content $hostsPath
$hosts = $hosts | ForEach-Object {if ($_ -match '^\s*#\s*(.*?\d{1,3}.*?elastic.*)')
{$matches[1]} else {$_}}
$hosts | Out-File $hostsPath -enc ascii

# Comment lines with localhost on them:
$hosts = get-content $hostsPath
$hosts | Foreach {if ($_ -match '^\s*([^#].*?\d{1,3}.*?localhost.*)')
{"# " + $matches[1]} else {$_}} |
Out-File $hostsPath -enc ascii

0 comments on commit e26770c

Please sign in to comment.