{{announcement.body}}
{{announcement.title}}

Orchestrating Dead-Simple Service Meshes With Supergloo

DZone 's Guide to

Orchestrating Dead-Simple Service Meshes With Supergloo

Currently, the most well-known service mesh is Istio with the backing of Lyft, Google, and IBM. However, there are many options to choose from.

· Cloud Zone ·
Free Resource

What Is a Service Mesh?

Service meshes are all the rage in the Kubernetes world these days, but a lot of people seem to be a bit confused as to what they do and why (when) they need one. The best way to think of a service mesh is to imagine well...a mesh! The service mesh is a configurable, low‑latency infrastructure layer designed to handle communication between the processes among different services using application programming interfaces (APIs). It ensures that communication among containerized and often ephemeral application infrastructure services is fast, reliable, and secure. The mesh also provides critical capabilities that include:

  • Service discovery
  • Load Balancing
  • Encryption
  • Observability
  • Authentication

The service mesh is usually implemented by providing a proxy instance, called a sidecar, for each service instance. Sidecars handle inter-service communications, monitoring, and security‑related concerns - anything can be abstracted away from the individual sources. This way, developers can handle development, support, and maintenance for the application code in the services; operations teams can maintain the service mesh and run the app.

Currently, the most well-known service mesh is Istio with the backing of Lyft, Google, and IBM. However, there are many options and the tool I'm going to show you today is going to help you get started with your first service mesh on various platforms.

Let's go ahead and check out SuperGloo!

What Is SuperGloo?

With all of the varied offerings in the service mesh landscape, it makes it difficult to take on the complexities of experimenting with even a single service mesh solution, let alone multiple ones. The goal of SuperGloo is to take charge of these complexities and make it easy for users to deploy multiple service meshes into their environment.

SuperGloo abstracts away key functionalities associated with the service mesh such as:

  • Encryption
  • Telemetry
  • Tracing

Using tools like SuperGloo, you can pair any service mesh with any ingress, and leave it to the abstraction to take care of the installation and configuration necessary to let them work together.

Let's try it out!

Getting Started With SuperGloo

Prerequisites

  • A running Kubernetes cluster
  • Helm (Optional)

Installing a Command-Line Tool (CLI)

The supergloo command-line makes it much easier to install and operate SuperGloo, though it is not required.

To install using the Homebrew package manager, run the following.

brew install solo-io/tap/supergloo

To install on any platform run the following.

curl -sL https://run.solo.io/supergloo/install | sh

You can download the CLI directly via the GitHub releases page. You need to add SuperGloo to your path after downloading.

export PATH=$HOME/.supergloo/bin:$PATH

Verify the CLI is installed and running correctly with:

supergloo --version

Install the SuperGloo Controller to Your Kubernetes Cluster Using Supergloo Init

Once your Kubernetes cluster is up and running, run the following command to deploy the SuperGloo Controller and Discovery pods to the supergloo-system namespace:

YAML
 




x
18


 
1
supergloo init 
2
 
          
3
installing supergloo version 0.3.14 
4
using chart uri https://storage.googleapis.com/supergloo-helm/charts/supergloo-0.3.14. 
5
tgz 
6
configmap/sidecar-injection-resources created 
7
serviceaccount/supergloo created 
8
serviceaccount/discovery created 
9
serviceaccount/mesh-discovery created 
10
clusterrole.rbac.authorization.k8s.io/discovery created 
11
clusterrole.rbac.authorization.k8s.io/mesh-discovery created 
12
clusterrolebinding.rbac.authorization.k8s.io/supergloo-role-binding created 
13
clusterrolebinding.rbac.authorization.k8s.io/discovery-role-binding created 
14
clusterrolebinding.rbac.authorization.k8s.io/mesh-discovery-role-binding created 
15
deployment.extensions/supergloo created 
16
deployment.extensions/discovery created 
17
deployment.extensions/mesh-discovery created 
18
install successful!



You can see the Kubernetes YAML supergloo is installing to your cluster without installing by running supergloo init --dry-run.

NOTE: You can install SuperGloo to an existing namespace by providing the--namespace option. If the option is not provided, the namespace defaults to supergloo-system.

supergloo init --namespace my-namespace

Check that the SuperGloo and Discovery pods have been created:

kubectl --namespace supergloo-system get all

NAME                                 READY   STATUS    RESTARTS   AGE 
pod/discovery-68df78f9c-rk2w4        1/1     Running   0          2m49s 
pod/mesh-discovery-bc9fbcb7f-z84r9   1/1     Running   0          2m49s 
pod/supergloo-59445698c5-p2fvm       1/1     Running   0          2m49s 

NAME                             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE 
deployment.apps/discovery        1         1         1            1           2m49s 
deployment.apps/mesh-discovery   1         1         1            1           2m49s 
deployment.apps/supergloo        1         1         1            1           2m49s 

NAME                                       DESIRED   CURRENT   READY   AGE 
replicaset.apps/discovery-68df78f9c        1         1         1       2m49s 
replicaset.apps/mesh-discovery-bc9fbcb7f   1         1         1       2m49s 
replicaset.apps/supergloo-59445698c5       1         1         1       2m49s

Install SuperGloo Using Helm

Add the SuperGloo Helm charts to your local Helm installation.

helm repo add supergloo http://storage.googleapis.com/supergloo-helm

You can examine the available versions of SuperGloo by running the following command

helm search supergloo/supergloo --versions

NAME                   CHART VERSION    APP VERSION    DESCRIPTION 
supergloo/supergloo    0.3.16                          The official Helm Chart for SuperGloo 
supergloo/supergloo    0.3.15                          The official Helm Chart for SuperGloo 
supergloo/supergloo    0.3.14                          The official Helm Chart for SuperGloo 
supergloo/supergloo    0.3.13                          The official Helm Chart for SuperGloo 
supergloo/supergloo    0.3.12                          The official Helm Chart for SuperGloo 
supergloo/supergloo    0.3.11                          The official Helm Chart for SuperGloo ...

Installing Linkerd With SuperGloo

First, ensure that SuperGloo has been initialized in your Kubernetes cluster via supergloo init or the Supergloo Helm Chart. See the installation instructions for detailed instructions on installing SuperGloo.

Once SuperGloo has been installed, we’ll create an Install CRD with configuration parameters which will then trigger SuperGloo to begin the mesh installation.

This can be done in one of two ways:

Option 1: Using the Supergloo CLI

supergloo install linkerd --name linkerd

See supergloo install linkerd --help for the full list of installation options for Linkerd.

Option 2: Using Kubectl Apply on a YAML File

YAML
 




xxxxxxxxxx
1
13


 
1
cat <<EOF | kubectl apply --filename - 
2
apiVersion: supergloo.solo.io/v1 
3
kind: Install 
4
metadata:
5
  name: linkerd 
6
spec:
7
  installationNamespace: linkerd
8
  mesh:
9
    linkerdMesh:
10
      enableAutoInject: true
11
      enableMtls: true
12
      linkerdVersion: stable-2.3.0 
13
EOF



Once you’ve created the Install CRD, you can track the progress of the Linkerd installation:

kubectl --namespace linkerd get pod --watch

NAME                                      READY   STATUS    RESTARTS   AGE 
linkerd-ca-585f97b595-l96mj               1/1     Running   0          46s 
linkerd-controller-6954987c97-mjj8l       3/3     Running   0          45s 
linkerd-grafana-7c6bbd8d-6vnqp            1/1     Running   0          46s 
linkerd-prometheus-644f9f4754-5m2l8       1/1     Running   0          46s 
linkerd-proxy-injector-8449944ffc-clh6j   1/1     Running   0          8s 
linkerd-web-546b557f56-xsjqf              1/1     Running   0          5s

To tear everything down from this demo:

kubectl --namespace default delete --filename

https://raw.githubusercontent.com/istio/istio/1.0.6/samples

/bookinfo/platform/kube/bookinfo.yaml 
kubectl delete namespace not-injected

Uninstalling Linkerd

If the disabled field is set to true on the install CRD. Doing so, again we have two options:

Option 1: Using the Supergloo CLI

supergloo uninstall --name linkerd

Option 2: Using Kubectl Edit and Set Spec.Disabled: True:

kubectl edit install linkerd

# Please edit the object below. Lines beginning with a '#' will be ignored, 
# and an empty file will abort the edit. If an error occurs while saving this file will be 
# reopened with the relevant failures. 
#
apiVersion: supergloo.solo.io/v1 
kind: Install 
metadata:
  name: linkerd
  namespace: supergloo-system 
spec:
   ## add the following line
   disabled: true
   ##
   installationNamespace: linkerd
   mesh:
     installedMesh:
       name: linkerd
       namespace: supergloo-system
     linkerdMesh:
       enableAutoInject: true
       enableMtls: true
       linkerdVersion: stable-2.3.0

Installing Istio With SuperGloo

First, ensure that SuperGloo has been initialized in your Kubernetes cluster via supergloo init or the Supergloo Helm Chart. See the installation instructions for detailed instructions on installing SuperGloo.

Once SuperGloo has been installed, we’ll create an Install CRD with configuration parameters which will then trigger SuperGloo to begin the mesh installation.

This can be done in one of two ways:

Option 1: Using the Supergloo CLI

supergloo install istio --name istio --installation

-namespace istio-system --mtls=true --auto-inject=true

See supergloo install istio --help for the full list of installation options for istio.

Option 2: Using kubectl apply on a YAML File

YAML
 




xxxxxxxxxx
1
17


 
1
cat <<EOF | kubectl apply --filename - 
2
apiVersion: supergloo.solo.io/v1 
3
kind: Install 
4
metadata:
5
  name: my-istio
6
  namespace: supergloo-system 
7
spec:
8
  installationNamespace: istio-system
9
  mesh:
10
    istio:
11
      enableAutoInject: true
12
      enableMtls: true
13
      installGrafana: true
14
      installJaeger: true
15
      installPrometheus: true
16
      version: 1.0.6 
17
EOF



Once you’ve created the Install CRD, you can track the progress of the istio installation:

kubectl --namespace istio-system get pod --watch

NAME                                      READY     STATUS              RESTARTS   AGE 
grafana-7f6cd4bf56-xst2n                  1/1       Running             0          27s 
istio-citadel-796c94878b-59gw6            1/1       Running             0          26s 
istio-cleanup-secrets-xd6f8               0/1       Completed           0          27s 
istio-galley-6c68c5dbcf-z6j5k             1/1       Running             0          27s 
istio-pilot-c5dddb4b9-nb6fd               2/2       Running             0          26s 
istio-policy-977d74ff4-669vk              2/2       Running             0          27s 
istio-sidecar-injector-6d8f88c98f-5f58t   1/1       Running             0          26s 
istio-telemetry-5f79796bf6-fl4sn          2/2       Running             0          27s 
istio-tracing-7596597bd7-lc92t            1/1       Running             0          26s 
prometheus-76db5fddd5-55r6d               1/1       Running             0          26s

Deploying the Bookinfo Example

A good place to go from here is the try out deploying the Istio Bookinfo example app. To deploy the bookinfo sample, first enable automatic sidecar injection on the default namespace (or any namespace of your choosing):

Istio Injection Label

kubectl label namespace default istio-injection=enabled

Linkerd Injection Annotation

kubectl annotate namespace default linkerd.io/inject=enabled

Next, create the bookinfo deployments and services:

kubectl --namespace default apply --filename \
    https://raw.githubusercontent.com/solo-io/supergloo/master

/test/e2e/files/bookinfo.yaml

We should be up and running in a few minutes:

kubectl --namespace default get pod --watch

NAME                             READY     STATUS    RESTARTS   AGE 
details-v1-6764bbc7f7-k4rhk      2/2       Running   0          27s 
productpage-v1-54b8b9f55-sxxnw   2/2       Running   0          27s 
ratings-v1-7bc85949-kh4f9        2/2       Running   0          27s 
reviews-v1-fdbf674bb-z467l       2/2       Running   0          27s 
reviews-v2-5bdc5877d6-gvgns      2/2       Running   0          27s 
reviews-v3-dd846cc78-55wr5       2/2       Running   0          27s


We should see 2/2 containers are READY, since one of those containers is the sidecar injected by either Istio or Linkerd.

And We're Done!

There you have it! Deploying service meshes with SuperGloo is a simple task with the abstraction they provide. I hope that this brief intro provides you with a new tool to add to your toolbox, and hopefully, it might even make a tough deployment easier for you. Until next time, thanks for reading.

Topics:
cloud, cloud native, istio, kubernetes, linkerd, microservice, service mesh, tutorial

Published at DZone with permission of Sudip Sengupta . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}