Skip to content

monk-io/monk-memcached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Monk & Memcached

This repository contains Monk.io template to deploy Memcached system either locally or on cloud of your choice (AWS, GCP, Azure, Digital Ocean).

Start

Set up Monk - https://docs.monk.io/docs/monk-in-10/

Start monkd and login.

monk login --email=<email> --password=<password>

Clone Monk Memcached repository

In order to load templates and change configuration simply use below commands:

git clone https://github.com/monk-io/monk-memcached

# and change directory to the monk-memcached template folder
cd monk-memcached

Configuration

You can add/remove configuration of the template.

The current variables can be found in memcached/stack/variables section

  variables:
    memcached-image-tag: "1.6.17-debian-11-r24"
    memcached-cache-size: 128
    memcached-max-connections: 2000
    memcached-threads: 4
    memcached-max-item-size: 8388608
    memcached-username: "my_user"
    memcached-password: "my_password"
    memcached-extra-flags: ""

Template variables

Variable Description Type Example
memcached-image-tag Memcached image version. string latest
memcached-cache-size Cache size in MB. int 128
memcached-max-connections Maximum int of concurrent connections . int 2000
memcached-threads Amount of threads for which to process requests for int 4
memcached-max-item-size Max item size . int 8388608
memcached-username Memcached admin user. string my_user
memcached-password Memcached admin user password. string my_password
memcached-extra-flags Passing extra command-line flags. string ""

Local Deployment

First clone the repository simply run below command after launching monkd:
➜  monk load MANIFEST
✔ Read files successfully
✔ Loaded memcached.yaml successfully

Loaded 2 runnables, 0 process groups, 0 services, 0 entities and 0 entity instances
✨ Loaded:
 └─🔩 Runnables:
    ├─🧩 memcached/memcached
    └─🧩 memcached/base
✔ All templates loaded successfully

➜  monk list -l memcached
✔ Got the list
Type      Template             Repository  Version  Tags
runnable  memcached/base       local       -        Memcached, Distributed Caching, In-Memory Cache, High-Performance, Scalability, Key-Value Store, Open Source, Data Retrieval, Web Caching, Cache Management, Server-Side Caching, API Caching, Cloud Computing, Microservices, NoSQL
runnable  memcached/memcached  local       -        Memcached, Distributed Caching, In-Memory Cache, High-Performance, Scalability, Key-Value Store, Open Source, Data Retrieval, Web Caching, Cache Management, Server-Side Caching, API Caching, Cloud Computing, Microservices, NoSQL

➜  monk run  memcached/memcached

✔ Started local/memcached/memcached

This will start the entire memcached/stack.

Cloud Deployment

To deploy the above system to your cloud provider, create a new Monk cluster and provision your instances.

➜  monk cluster new
? New cluster name memcached
✔ Cluster created
Your cluster has been created successfully.

➜  monk cluster provider add -p gcp -f <path/to/your-key.json>
✔ Provider added successfully

➜  monk cluster grow -p gcp
? Cloud provider gcp
? Name of the new instance memcached-instance
? Tags (split by whitespace) memcached
? Region europe-central2
? Zone europe-central2-a
? Instance type e2-medium
? Number of instances (or press ENTER to use default = 1) 3
? Default disk type for gcp is HDD (pd-standard). Would you like to change it? No
? Disk size (or press ENTER to use default = 250 GBs) 50
✔ Start creation of new instance(s) on gcp... DONE
✔ Creating node: my-instance-1 DONE
✔ Initializing node: my-instance-1 DONE
✔ Creating node: my-instance-2 DONE
✔ Initializing node: my-instance-2 DONE
✔ Creating node: my-instance-3 DONE
✔ Initializing node: my-instance-3 DONE
✔ Connecting: my-instance-1 DONE
✔ Syncing peer: my-instance-1 DONE
✔ Connecting: my-instance-2 DONE
✔ Connecting: my-instance-3 DONE
✔ Syncing peer: my-instance-2 DONE
✔ Syncing peer: my-instance-3 DONE
✔ Syncing nodes DONE
✔ Cluster grown successfully

Logs & Shell

# show Memcached logs
➜  monk logs -l 1000 -f memcached/memcached

# access shell in the container running Memcached
➜  monk shell memcached/memcached

Stop, remove and clean up workloads and templates

➜ monk purge -x  memcached/memcached

✔ memcached/memcached purged

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •