Skip to content

Commit

Permalink
fix K8S_DASHBOARD env var usage
Browse files Browse the repository at this point in the history
Use `to_bool` func to convert the string to bool.

improve README.md description for some vars, see #49

Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Sep 1, 2019
1 parent 62d403b commit 326ff49
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,31 +190,31 @@ versions Print the "imporant" tools versions out for easie

## Variables

| Variable Name | Default Value | Description |
| ------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BOX_OS` | `fedora` | Which set of Vagrantfiles to use to start the VMs. |
| `BOX_IMAGE` | `` | Set the VM box image to use (only for override purposes). |
| `DISK_COUNT` | `1` | Set how many additional disks will be added to the VMs. |
| `DISK_SIZE_GB` | `25` GB | Size of additional disks added to the VMs. |
| `MASTER_CPUS` | `2` Core | Amount of cores to use for the master VM. |
| `MASTER_MEMORY_SIZE_GB` | `2` GB | Size of memory (in GB) to be allocated for the master VM. |
| `NODE_CPUS` | `2` | Amount of cores to use for each node VM. |
| `NODE_MEMORY_SIZE_GB` | `2` GB | Size of memory (in GB) to be allocated for each node VM. |
| `NODE_COUNT` | `2` | How many worker nodes should be spawned. |
| `MASTER_IP` | `192.168.26.10` | The Kubernetes master node IP. |
| `NODE_IP_NW` | `192.168.26.` | The first three parts of the IPs used for the nodes. |
| `POD_NW_CIDR` | `10.244.0.0/16` | The Pod (container) network CIDR. |
| `K8S_DASHBOARD` | `false` | Install the Kubernetes dashboard addon. |
| `K8S_DASHBOARD_VERSION` | `v1.10.1` | The Kubernetes dashboard addon version. Note that there is a breaking change in the kubernetes dashboard repository after the 1.10.1 version. |
| `CLUSTER_NAME` | `k8s-vagrant-multi-node` | The name of the directory the Makefile is in. |
| `KUBETOKEN` | `""` (empty) | The `kubeadm` "join" token to use. Will be generated automatically using `/dev/urandom/` when empty. |
| `KUBEADM_INIT_FLAGS` | `""` (empty) | The `kubeadm init` flags to use. |
| `KUBEADM_JOIN_FLAGS` | `""` (empty) | The `kubeadm join` flags to use. |
| `KUBERNETES_VERSION` | `""` (empty) | The `kubeadm` and `kubelet` package and API server version to install (`KUBEADM_INIT_FLAGS` will be set to `--kubernetes-version=$KUBERNETES_VERSION` if unset). |
| `KUBERNETES_PKG_VERSION_SUFFIX` | `""` (empty) | String which will be appended to the `kubeadm` and `kubelet` package versions when installed (only used for `vagrantfiles/ubuntu`). |
| `KUBE_PROXY_IPVS` | `false` | Enable IPVS kernel modules to then use IPVS for the kube-proxy. |
| `KUBE_NETWORK` | `flannel` | What CNI to install, if empty don't install any CNI. `flannel`, `canal` and `calico` are supported options. |
| `KUBECTL_AUTO_CONF` | `true` | If `kubectl` should be automatically configured to be able to talk with the cluster (if disabled, removes need for `kubectl` binary). |
| Variable Name | Default Value | Description |
| ------------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BOX_OS` | `fedora` | Which set of Vagrantfiles to use to start the VMs. |
| `BOX_IMAGE` | `` | Set the VM box image to use (only for override purposes). |
| `DISK_COUNT` | `1` | Set how many additional disks will be added to the VMs. |
| `DISK_SIZE_GB` | `25` GB | Size of additional disks added to the VMs. |
| `MASTER_CPUS` | `2` Core | Amount of cores to use for the master VM. |
| `MASTER_MEMORY_SIZE_GB` | `2` GB | Size of memory (in GB) to be allocated for the master VM. |
| `NODE_CPUS` | `2` | Amount of cores to use for each node VM. |
| `NODE_MEMORY_SIZE_GB` | `2` GB | Size of memory (in GB) to be allocated for each node VM. |
| `NODE_COUNT` | `2` | How many worker nodes should be spawned. |
| `MASTER_IP` | `192.168.26.10` | The Kubernetes master node IP. |
| `NODE_IP_NW` | `192.168.26.` | The first three parts of the IPs used for the nodes. |
| `POD_NW_CIDR` | `10.244.0.0/16` | The Pod (container) network CIDR used for the CNI. |
| `K8S_DASHBOARD` | `false` | Install the Kubernetes dashboard addon. |
| `K8S_DASHBOARD_VERSION` | `v1.10.1` | The Kubernetes dashboard addon version. Note it is recommended to at least version `1.10.1`. |
| `CLUSTER_NAME` | `k8s-vagrant-multi-node` | The name of the directory the Makefile is in. **This is not the Kubernetes cluster name**, due to `kubeadm init` limitations. |
| `KUBETOKEN` | `""` (empty) | The `kubeadm` "join" token to use. Will be generated automatically using `/dev/urandom/` when empty. |
| `KUBEADM_INIT_FLAGS` | `""` (empty) | The `kubeadm init` flags to use. (When `KUBERNETES_VERSION` is set and `KUBEADM_INIT_FLAGS` is empty, `KUBEADM_INIT_FLAGS` will automatically be set to `--kubernetes-version=$KUBERNETES_VERSION`). |
| `KUBEADM_JOIN_FLAGS` | `""` (empty) | The `kubeadm join` flags to use. |
| `KUBERNETES_VERSION` | `""` (empty) | The `kubeadm` and `kubelet` package and API server version to install. Must be a fully qualified version string, e.g., `v1.15.3` and not just `v1.15`. |
| `KUBERNETES_PKG_VERSION_SUFFIX` | `""` (empty) | String which will be appended to the `kubeadm` and `kubelet` package versions when installed (only used for `vagrantfiles/ubuntu`). |
| `KUBE_PROXY_IPVS` | `false` | Enable IPVS kernel modules to then use IPVS for the kube-proxy. |
| `KUBE_NETWORK` | `flannel` | What CNI to install, if empty don't install any CNI. `flannel`, `canal` and `calico` are supported options. |
| `KUBECTL_AUTO_CONF` | `true` | If `kubectl` should be automatically configured to be able to talk with the cluster (if disabled, removes need for `kubectl` binary). |

## Demo

Expand Down
4 changes: 2 additions & 2 deletions vagrantfiles/Vagrantfile_common
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ NODE_IP_NW = ENV['NODE_IP_NW'] || '192.168.26.'
NODE_IP = NODE_IP_NW + (NODE + 10).to_s

# Addons
K8S_DASHBOARD = ENV['K8S_DASHBOARD'] || false
K8S_DASHBOARD_VERSION = ENV['K8S_DASHBOARD_VERSION'] || 'v1.10.1'
K8S_DASHBOARD = ENV['K8S_DASHBOARD'].to_bool || false
K8S_DASHBOARD_VERSION = ENV['K8S_DASHBOARD_VERSION'] || 'v1.15.3'

This comment has been minimized.

Copy link
@scaleoutsean

scaleoutsean Sep 1, 2019

Contributor
  1. Is this a typo? https://github.com/kubernetes/dashboard/releases shows no such version.
  2. I just looked at the releases link above and realized that v1.10.1 is good for up to K8S v1.13, then there's one v2.0 beta release that works with K8S v1.14 and two other releases that work with K8S v1.15 so maybe Dashboard version should be determined semi-automatically based on K8S.

This comment has been minimized.

Copy link
@galexrt

galexrt Sep 1, 2019

Author Owner
  1. Yes, that was a typo.
  2. Unless a new stable version is released, the version will not be changed.

# Kubernetes and kubeadm
KUBERNETES_VERSION = ENV['KUBERNETES_VERSION'] || ''
Expand Down
2 changes: 1 addition & 1 deletion vagrantfiles/Vagrantfile_master
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Vagrant.configure('2') do |config|
subconfig.vm.provision :diskandreboot
subconfig.vm.provision :shell, inline: $kubeMasterScript
# Addons
if K8S_DASHBOARD.to_s == 'true'
if K8S_DASHBOARD
subconfig.vm.provision :shell, inline: $kubeDashScript
subconfig.vm.network 'forwarded_port', guest: 8443, host: 2443
end
Expand Down

0 comments on commit 326ff49

Please sign in to comment.