You must have an account created in IBM Cloud. The account needs to either be Pay-As-You-Go or Subscription. Click here to read more. If you have a Lite account, you can upgrade it. Click here to learn how to upgrade.
- Click on the search section at the top of the main page, type Kubernetes, and then choose Kubernetes Service.
- In the new window, select between the free and standard type under "Pricing plan". Once selected, click on create.
We'll choose the Standard Plan for this documentation as the Free Plan may fall short in resources when deploying your pods. We highly recommend using a Standard Plan with the hardware that suits you the best. If you're selecting the Standard Plan, please make sure you select the adequate requirements,
- Select your Kubernetes Version to be the latest available or the required one by your application. In this example, we have set it to be '1.18.13'.
- Select Infrastructure as 'Classic'.
- Leave Resource Group to 'Default'.
- Select Geography to the one that suits you better or that fits your infrastructure.
- Select Availability to be 'Single Zone' or 'Multi Zone' depending on your needs.
- Select a Worker Zone that suits you better or that fits your infrastructure.
- Select the number of workers in Worker Pool.
- Give your Worker Pool a name.
- Leave the Encrypt Local Disk option 'On'
- Choose 'Both private and public endpoints' on Master Service Endpoint
- Give your cluster a name in 'cluster-name'
- Provide the tags to your cluster and click on Create.
Wait a few minutes while your cluster is deployed.
The following checkmark and the word 'normal' will appear once the Kubernetes Cluster is deployed. You can check it under your cluster section which is located in your Resources List.
- Click on the search section at the top of the main page, select IBM Cloud Block Storage, and click on it.
- A new window opens, select the cluster and enter the name you want for this workspace, in this case, it will be called storage-example, accept the terms, click Install and wait a few minutes.
- Click on the search section at the top of the main page, type Moodle(TM) LMS, and click on it.
- A new window opens, select the cluster and put the name you want to the workspace, in this case it will be called moodle-example; then, go to the bottom to find the workspace parameters. You can modify the different installation parameters at the bottom. We will leave them by default except for the credentials Moodle uses for its database and its application. You will need the first to access your database console and the second one to access your new Moodle application. You can read more about setting up the parameters here.
Make sure you set up correctly the email and password for the application in the moodleEmail and moodlePassword variables.
You can also set up a new database user in the mariadb.auth.username variable. Don't forget to set the password for that user in the mariadb.auth.password variable. The admin user will be root by default, and you can change its password in the mariadb.auth.rootPassword.
When you're done, accept the terms, and click on Install.
- Go to Resources List in the Left Navigation Menu and click on Kubernetes.
- Click the Actions button and select Web terminal.
- A window opens to install the web terminal, click on install and wait a few minutes. The window will pop up at the buttom If the web terminal is already installed.
- Once you have installed the terminal, click on the action button again, select web terminal, and type the following command. It will show you the workspaces of your cluster. You can see moodle_example is now active.
$ kubectl get ns
- Check the namespace moodle-example or the namespace you have specific in namespace, and make sure the pods are running.
$ kubectl get pod -n NAMESERVICE -o wide
$ kubectl get service -n NAME SERVICE
$ kubectl exec --stdin --tty PODNAME -n NAMESPACE -- /bin/bash
You have finished the installation and enjoy your new Moodle site by accessing the load balancer's public IP. It is important to note that the VPC selected in the Kubernetes Cluster created should have an Internet Gateway to correctly access the IP. You can also assign a custom domain by modifying the corresponding variable in the Moodle installation parameters. You have finished the installation, enjoy!