Deploy Apache on IBM Cloud

Image for post
Image for post

You should have an IBM Cloud account, otherwise you can register here.
At the end of the tutorial you will have a cluster with an Apache up and running.

1. We will provision a new Kubernetes Cluster for you if, you already have one skip to step 2
2. We will deploy the IBM Cloud Block Storage plug-in, if already have it skip to step 3
3. Apache deployment

Image for post
Image for post
  • Click the Catalog button on the top
  • Select Service from the catalog
  • Search for Kubernetes Service and click on it
Image for post
Image for post
  • You are now at the Kubernetes deployment page, you need to specify some details about the cluster
  • Choose a plan standard or free, the free plan only has one worker node and no subnet, to provision a standard cluster, you will need to upgrade you account to Pay-As-You-Go
  • To upgrade to a Pay-As-You-Go account, complete the following steps:
  • 1. In the console, go to Manage > Account.
    2. Select Account settings, and click Add credit card.
    3. Enter your payment information, click Next, and submit your information
  • Choose classic or VPC, read the docs and choose the most suitable type for yourself
  • Now choose your location settings, for more information please visit Locations
  • Choose Geography (continent)
Image for post
Image for post
  • Choose Single or Multizone, in single zone your data is only kept in on datacenter, on the other hand with Multizone it is distributed to multiple zones, thus safer in an unforeseen zone failure
Image for post
Image for post
  • Choose a Worker Zone if using Single zones or Metro if Multizone
Image for post
Image for post
  • If you wish to use Multizone please set up your account with VRF or enable Vlan spanning
  • If at your current location selection, there is no available Virtual LAN, a new Vlan will be created for you
  • Choose a Worker node setup or use the preselected one, set Worker node amount per zone
Image for post
Image for post
  • Choose Master Service Endpoint, In VRF-enabled accounts, you can choose private-only to make your master accessible on the private network or via VPN tunnel. Choose public-only to make your master publicly accessible. When you have a VRF-enabled account, your cluster is set up by default to use both private and public endpoints. For more information visit endpoints.
Image for post
Image for post
  • Give cluster a name
Image for post
Image for post
  • Give desired tags to your cluster, for more information visit tags
Image for post
Image for post
  • Click create
Image for post
Image for post
  • Wait for you cluster to be provisioned
Image for post
Image for post
  • Your cluster is ready for usage
Image for post
Image for post

The Block Storage plug-in is a persistent, high-performance iSCSI storage that you can add to your apps by using Kubernetes Persistent Volumes (PVs).

  • Click the Catalog button on the top
  • Select Software from the catalog
  • Search for IBM Cloud Block Storage plug-in and click on it
Image for post
Image for post
  • On the application page Click in the dot next to the cluster, you wish to use
  • Click on Enter or Select Namespace and choose the default Namespace or use a custom one (if you get error please wait 30 minutes for the cluster to finalize)
Image for post
Image for post
  • Give a name to this workspace
  • Click install and wait for the deployment
Image for post
Image for post
  • We will deploy Apache on our cluster
  • Click the Catalog button on the top
  • Select Software from the catalog
  • Search for Apache and click on it
Image for post
Image for post
  • On the application page Click in the dot next to the cluster, you wish to use
Image for post
Image for post
  • Click on Enter or Select Namespace and choose the default Namespace or use a custom one
Image for post
Image for post
  • Give a unique name to workspace, which you can easily recognize
Image for post
Image for post
  • Give tags to your apache workspace, for more information visit [tags]
Image for post
Image for post
  • Click on Parameters with default values, You can set deployment values or use the default ones
Image for post
Image for post
  • After finishing everything, tick the box next to the agreements and click install
Image for post
Image for post
  • The apache workspace will start installing, wait a couple of minutes
Image for post
Image for post
  • You apache workspace has been successfully deployed
Image for post
Image for post
  • Go to Resources in your browser
  • Click on Clusters
  • Click on your Cluster
Image for post
Image for post
  • Now you are at you clusters overview, here Click on Actions and Web terminal from the dropdown menu
Image for post
Image for post
  • Click install — wait couple of minutes
Image for post
Image for post
  • Click on Actions
  • Click Web terminal → a terminal will open up
  • Type in the terminal, please change NAMESPACE to the namespace you choose at the deployment setup:

$ kubectl get ns

Image for post
Image for post

$ kubectl get pod -n NAMESPACE -o wide

Image for post
Image for post

$ kubectl get service -n NAMESPACE

Image for post
Image for post
  • Running Apache service will be visible
  • Copy the External IP, you can access the website on this IP
  • Paste it into your browser
  • Apache welcome message will be visible
Image for post
Image for post

You successfully deployed an Apache webserver on IBM Cloud!

Written by

Keep It Simple, Short (& Stupid)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store