Install GlusterFS
This tutorial demonstrates how to use KubeKey to set up a KubeSphere cluster and configure GlusterFS to provide storage services.
Note
Ubuntu 16.04 is used as an example in this tutorial.
You have set up your GlusterFS cluster and configured Heketi. For more information, see Set up a GlusterFS Server.
Step 1: Configure the Client Machine
You need to install the GlusterFS client package on all your client machines.
Install .
Add the community GlusterFS PPA.
add-apt-repository ppa:gluster/glusterfs-7
Make sure you are using the latest package.
apt-get update
Install the GlusterFS client.
apt-get install glusterfs-server -y
Verify your GlusterFS version.
glusterfs -V
The separate configuration file contains all parameters of GlusterFS storage which will be used by KubeKey during installation.
Go to one of the nodes (taskbox) where you want to download KubeKey later and run the following command to create a configuration file.
vi glusterfs-sc.yaml
An example configuration file (include a Heketi Secret):
- Use the field
storageclass.beta.kubernetes.io/is-default-class
to setglusterfs
as your default storage class. If it isfalse
, KubeKey will install OpenEBS as the default storage class. - For more information about parameters in the storage class manifest, see the Kubernetes documentation.
Save the file.
Step 3: Download KubeKey
Follow the steps below to download KubeKey on the taskbox.
Download KubeKey from its or use the following command directly.
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -
Run the following command first to make sure you download KubeKey from the correct zone.
export KKZONE=cn
Run the following command to download KubeKey:
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -
Note
After you download KubeKey, if you transfer it to a new machine also with poor network connections to Googleapis, you must run export KKZONE=cn
again before you proceed with the steps below.
Note
The commands above download the latest release (v1.2.0) of KubeKey. You can change the version number in the command to download a specific version.
Make kk
executable:
chmod +x kk
Specify a Kubernetes version and a KubeSphere version that you want to install. For example:
./kk create config --with-kubernetes v1.21.5 --with-kubesphere v3.2.0
Note
Recommended Kubernetes versions for KubeSphere 3.2.0: v1.19.x, v1.20.x, v1.21.x or v1.22.x (experimental). If you do not specify a Kubernetes version, KubeKey will install Kubernetes v1.21.5 by default. For more information about supported Kubernetes versions, see Support Matrix.
If you add the flag
--with-kubesphere
without specifying a KubeSphere version, the latest version of KubeSphere will be installed.
A default file
config-sample.yaml
will be created if you do not customize the name. Edit the file.metadata:
name: sample
spec:
hosts:
- {name: client1, address: 192.168.0.5, internalAddress: 192.168.0.5, user: ubuntu, password: Testing123}
- {name: client2, address: 192.168.0.6, internalAddress: 192.168.0.6, user: ubuntu, password: Testing123}
roleGroups:
etcd:
- client1
master:
- client1
worker:
- client2
- client3
controlPlaneEndpoint:
domain: lb.kubesphere.local
address: ""
port: "6443"
kubernetes:
version: v1.21.5
imageRepo: kubesphere
clusterName: cluster.local
network:
plugin: calico
kubePodsCIDR: 10.233.64.0/18
kubeServiceCIDR: 10.233.0.0/18
registry:
registryMirrors: []
insecureRegistries: []
addons:
- name: glusterfs
sources:
path:
- /root/glusterfs-sc.yaml
...
Pay special attention to the field of
addons
, under which you must provide the information of the storage class to be created as well as the Heketi Secret. For more information about each parameter in this file, see .Save the file and execute the following command to install Kubernetes and KubeSphere:
./kk create cluster -f config-sample.yaml
When the installation finishes, you can inspect installation logs with the following command:
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
Expected output:
#####################################################
### Welcome to KubeSphere! ###
#####################################################
Console: http://192.168.0.4:30880
Account: admin
Password: [email protected]
NOTES:
1. After you log into the console, please check the
monitoring status of service components in
"Cluster Management". If any service is not
ready, please wait patiently until all components
are up and running.
2. Please change the default password after login.
#####################################################
https://kubesphere.io 20xx-xx-xx xx:xx:xx
#####################################################
Step 5: Verify Installation
You can verify that GlusterFS has been successfully installed either from the command line or from the KubeSphere web console.
Run the following command to check your storage class.
kubectl get sc
Expected output:
KubeSphere console
Log in to the web console with the default account and password (
admin/[[email protected]](https://kubesphere.io/cdn-cgi/l/email-protection)
) at . Click Platform in the upper-left corner and select Cluster Management.Go to Volumes under Storage, and you can see PVCs in use.
Note
For more information about how to create volumes on the KubeSphere console, see Volumes.