Install on Kubernetes
This guide covers the necessary steps to install and configure the Grey Matter service mesh on a cloud based Kubernetes cluster. While these instructions should support all versions of Kubernetes, they have been tested and confirmed against versions 1.15, 1.16, 1.17, 1.18.
Warning: The Grey Matter mesh installed at the end of this guide is not intended for production use. Contact Grey Matter Customer Support for more information on a Production deployment.
Prerequisites
Grey Matter credentials requested via Grey Matter Support
Steps
1. Create Kubernetes Cluster
NOTE: If you already have a Kubernetes cluster up and running, move to Step 2. Just verify you can connect to the cluster with a command like
kubectl get nodes.
For this deployment, we'll use Amazon EKS to automatically provision a Kubernetes cluster for us. eksctl will use your preconfigured default AWS credentials to create master and worker nodes to our specifications, and configure kubectl so we can manipulate the cluster.
The regions, node type/size and other settings used below may need to be tuned to your use case. The minimum Kubernetes version supported by each platform slowly moves over time, so this may need to be updated periodically. Run, the following commands:
eksctl create cluster \
--name production \
--version 1.17 \
--nodegroup-name workers \
--node-type m5.2xlarge \
--nodes=2 \
--node-ami auto \
--region us-east-1 \
--zones us-east-1a,us-east-1b \
--profile defaultAfter 10 - 15 minutes, your cluster should be ready. You can test that your configuration is correct by running:
eksctl get cluster --region us-east-1 --profile default
eksctl get nodegroup --region us-east-1 --profile default --cluster productionFor this deployment, we'll use Google GKE to automatically provision a Kubernetes cluster for us. gcloud will create master and worker nodes to our specifications, and configure kubectl so we can manipulate the cluster.
The regions, node type/size and other settings used below may need to be tuned to your use case. The minimum Kubernetes version supported by each platform slowly moves over time, so this may need to be updated periodically. Run, the following commands:
gcloud container clusters create production \
--machine-type e2-standard-8 \
--num-nodes 2 \
--cluster-version 1.17 \
--zone us-central1-a \
--node-locations us-central1-aAfter 3-5 minutes, your cluster should be ready. You can test that your configuration is correct by running:
gcloud container clusters listFor this deployment, we'll use Microsoft AKS to automatically provision a Kubernetes cluster for us. az will create master and worker nodes to our specifications, and configure kubectl so we can manipulate the cluster.
The regions, node type/size and other settings used below may need to be tuned to your use case. The minimum Kubernetes version supported by each platform slowly moves over time, so this may need to be updated periodically. Run, the following commands:
Now we'll use az to retrieve our credentials and setup kubectl for access to the cluster.
After 3-5 minutes, your cluster should be ready. You can test that your configuration is correct by running:
2. Set up Credentials
The credentials identified in the prerequisite steps are used to create a Kubernetes Image Pull Secret that grants access to the Grey Matter Docker images in the Grey Matter Nexus Repository.
If you do not have credentials yet, please contact Grey Matter support.
3. Get the Grey Matter Helm Charts
The Grey Matter Helm Charts are available from our GitHub helm-charts repository. Run the following command to add our helm charts repository.
4. Set up Secrets
Using your credentials, create the following file and save it as credentials.yaml.
5. Generate Configurations
Run the following to download the base configuration file:
This file is where you can specify any custom configurations for the installation. The file downloaded as is will install Grey Matter with all default values. If you wish to modify the defaults, make changes to any existing values in global.yaml.
Some configuration changes will change the installation process.
If you set global.spire.enabled to false, skip the server and agent release installations in step 6.
If you set global.data.external.enabled to true, you will need to add the data installation to part 3 of step 6, helm install data greymatter/data -f global.yaml --set=global.environment=eks --set=global.waiter.service_account.create=false.
To set more complex configurations like image versions, service environment variables, etc., check out the values files in each of the Grey Matter helm charts. Any additional configurations you wish to set can be added to the global.yaml file with the same directory structure as found in the <chart>/values.yaml file.
For example, to set the version of the Grey Matter proxy for the edge proxy, just simply replace the version as indicated below:
6. Install
Grey Matter is made up of a handful of components, each handling different pieces of the overall platform. Once you have set up your credentials.yaml and global.yaml files, run the following steps in order:
Install the necessary secrets
Grey Matter requires several Kubernetes secrets. The necessary secrets have been extracted into a single helm-chart for ease of installation.
Install SPIRE server and agent
This guide will use SPIRE to issue certificates to enable mTLS through the mesh. These commands will install the SPIRE server and agents into the
spirenamespace.Before installing the agent, watch the server pod come up:
Wait until the server pod is 2/2:
Then, install the spire agent:
Verify SPIRE installation
The SPIRE agent runs as a DaemonSet, so the number of Agent pods is directly related to how many nodes are in your cluster.
Install Grey Matter Charts
At this point, we're ready to install Grey Matter. Grey Matter is installed through a series of Helm Charts that install the different components of Grey Matter. You'll notice we're also setting a few values on the command line. These could be updated in the
global.yamlfile, but we wanted to call them to your attention here.global.environment: This is set toeksto drive EKS specific configurationsedge.ingress.type: This is set toLoadBalancerto update the Edge service to modify it to a type of LoadBalancer.global.waiter.service_account.create: This is set to false to prevent the Sense helm-chart from attempting to create thewaiterservice account.
Notice in the edge installation we are setting
--set=edge.ingress.type=LoadBalancer, this value sets the service type for edge. The default isClusterIP. In this example we want an AWS ELB to be created automatically for edge ingress (see below), thus we are setting it toLoadBalancer. See the Kubernetes publishing services docs for guidance on what this value should be in your specific installation.If you receive
Error: could not find tillerafter running the above helm commands, then you're running an older version of Helm and must install Helm v3. If you need to manage multiple versions of Helm, we highly recommend using helmenv to easily switch between versions.While these are being installed, you can use the
kubectlcommand to check if everything is running. When all pods areRunningorCompleted, the install is finished and Grey Matter is ready to go.The running output will look like the following:
7. Accessing the Application
Get the User Certificate
By default, Grey Matter leverages mutual TLS (mTLS) communications for all traffic, including inbound traffic to the mesh. This means that all
httpsrequests must include TLS certificates whether that be via a web browser or RESTful client. The Grey Matter helm charts have the ability to generate random Ingress and User certificates to ensure unique certificates every time a cluster is launched. For web based authentication, these certificates can then be imported into a web browser, to access resources in the mesh.Following the instructions in this guide, Grey Matter will automatically provision the required mTLS certificates for the server and the user.
To get the user certificate, run these commands:
Then create a new p12 certificate and load it into your browser:
If you want to provide your own valid certificates for ingress, set
.Values.global.auto_generate_edge_certstofalseand provide the cert information in the secrets chart, at.Values.edge.certificate.ingress. You will need to ensure you have a valid User certificate from the same Certificate Authority for Grey Matter to authenticate the user.Access Grey Matter
An Amazon ELB will be created automatically when we specified the flags
--set=global.environment=eksand--set=edge.ingress.type=LoadBalancerduring installation. The ELB is accessible through the randomly created URL attached to the edge service:The output will look like the following:
Visit the url listed under
EXTERNAL-IP(e.g.https://a255c23a43350427a93a860856d52155-1106205970.us-east-1.elb.amazonaws.com:10808/) in the browser to access the Grey Matter application:
Configure the Grey Matter CLI
In order to add or modify service configurations, make sure you have the greymatter CLI installed.
To configure it for this installation, replace {edge-amazon-elb-dns} with the edge service external IP from step 5, and replace <path/to/greymatter/helm-charts> with the path on your machine to the Grey Matter Helm Charts directory in the block below:
Now if you can run greymatter list cluster and greymatter list catalog_cluster and there are no errors, the CLI is properly configured.
Cleanup
Delete the Grey Matter Installation
Delete The Kubernetes Cluster
NOTE: this deletion actually takes longer than the output would indicate to terminate all resources. Attempting to create a new cluster with the same name will fail for some time until all resources are purged.
Last updated
Was this helpful?