Deploy Memcached on KubeSphere

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Its API is available for the majority of popular languages.

This tutorial walks you through an example of deploying Memcached from the App Store of KubeSphere.

Prerequisites

  • Please make sure you enable the OpenPitrix system.
  • You need to create a workspace, a project, and a user account (project-regular) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the operator role. In this tutorial, you log in as project-regular and work in the project demo-project in the workspace demo-workspace. For more information, see Create Workspace, Project, Account and Role.

Hands-on Lab

Step 1: Deploy Memcached from App Store

  1. On the Overview page of the project demo-project, click App Store in the top left corner.

    in-app-store

  2. Find Memcached and click Deploy on the App Info page.

    memcached-app-store

    deploying-memcached

  3. Set a name and select an app version. Make sure Memcached is deployed in demo-project and click Next.

    deployment-confirm

  4. In App Config, you can use the default configuration or customize the configuration by editing the YAML file directly. Click Deploy to continue.

    edit-config

  5. Wait until Memcached is up and running.

    memcached-running

Step 2: Access Memcached

  1. Navigate to Services, click the service name of Memcached.

    memcached-service

  2. On the detail page, you can find the port number and Pod IP under Service Ports and Pods respectively.

    memcached-port-pod

  3. As the Memcached service is headless, access it inside the cluster through the Pod IP and port number. The basic syntax of Memcached telnet command is telnet HOST PORT. For example:

    1. # telnet 10.10.235.3 11211
    2. Trying 10.10.235.3...
    3. Connected to 10.10.235.3.
    4. Escape character is '^]'.
    5. set runoob 0 900 9
    6. memcached
    7. STORED
  4. For more information, see Memcached.