Instrumenting an Istio Cluster With Jaeger Tracing

You might be interested in these articles:

Envoy Tracing

In an Istio cluster, all applications are deployed with an Envoy proxy attached to them and Envoy supports integration with different tracing systems, this means, we can use Envoy’s features to automate tracing in our cluster.

This is what envoy can do for us:

  • Initiate a trace when a request is received
  • Propagate the trace-id over the cluster so spans can be connected
  • Send information to tracing services like Jaeger
Read More

Generating a GPG key in a script

In this post we are going to learn how to generate a GPG key without having to answer prompts so it can be added to a script if desired.

We start by creating a file where we’ll write the details for our key. This will be the content of the file:

1
2
3
4
5
6
7
8
9
10
11
%echo Generating GPG key
Key-Type: default
Key-Type: RSA
Key-Length: 3072
Subkey-Type: RSA
Subkey-Length: 3072
Name-Real: Carlos Sanchez
Name-Email: carlos@sanchez.mex
%no-protection
%commit
%echo done

And then we can use this command to generate the key:

1
gpg --batch --gen-key <file path>

We can find all the options for generating the key in unattended key generation documentation.

Read More

Introduction to Jaeger Tracing

Jaeger is an Open Source tracing framework written in Golang. Jaeger is compatible with OpenTracing which is an open source standard that specifies how tracing data should be formed.

Tracing

Tracing is concept that became popular with the rise of microservices (Service Oriented Architecture). When we work with microservices, the number of requests going through our internal network increases very quickly. To do its job a service might have to call a lot of services and some of those services might need to call other services.

When we make so many network requests it’s sometimes hard to understand where a failure is coming from. Tracing keeps track of the dependencies between different services and allows us to visualize it in a easy to understand manner.

Read More

Searching Related Documents With Elasticsearch

In my last article we learned how to get started with Elasticsearch. In this article we are going to learn some strategies for dealing with related documents.

Relationships

Relationships between documents depend on the type of data we are storing. Some examples of relationships:

  • Restaurants and locations, where a restaurant can have multiple locations, but a location can only belong to one restaurant. This is a one to many relationship.
  • Orders and users, where each order belongs to a user. A user can have multiple orders but an order belongs to a single user. Also, one to many.
  • Movies and actors. A movie can star multiple actors and an actor can star in multiple movies. Many to many relationship.
Read More

Introduction to Elasticsearch

Why do I need a search engine?

Search is everywhere. We use Google to find websites, we search for products in Amazon, we use keywords to find videos on Youtube, etc.

From the consumer side, it’s a great way to get the information we need quickly. From the producer side, it means that we need to make sure we provide this interface the users have come to expect.

Relational or document databases allow us to create indices and find pieces of information based on ids, but they don’t work for searching for various keywords inside a text or when there are typos or synonyms involved. This is where search engines become useful; when we need to index unstructured data and offer flexible search capabilities.

Read More

Monitoring Kubernetes Resources with Fabric8 Informers

In my previous article we learned how to use the fabric8 java kubernetes client. In this article we are going to explore their Informer API.

The Informer API can be used to monitor Kubernetes resources (pods, services, etc.). This can be useful for a number of things like performing actions when a resource is created, destroyed, etc.

Using Informers

Informers are used to monitor Kubernetes resources. We create an informer with SharedInformerFactory:

Read More

Kubernetes Java Client

If you are getting started with Kubernetes, you probably have been using kubectl to perform operations on your cluster. Kubectl is a client library that communicates with the Kubernetes cluster using the Kubernetes API.

In this article we are going to learn how to use the Kubernetes Java Client to communicate with our cluster from a Java program.

Installation

We can find the up-to-date instructions at the official installation documentation.

For Bazel, we need to have the maven repository configured in the workspace and the client-java artifact:

Read More

Resource Management in Kubernetes - Requests and Limits

This article assumes some basic knowledge of Kubernetes. If you need an introduction to Kubernetes you can look at:

Why do we need to know about requests and limit

If we tried to run a pod that requires 8GB of memory in a host that only has 4GB of memory, the host would run out of memory and it would crash. In this article we are going to learn how to specify how much resources a pod needs so the scheduler can make better decisions about where to run pods.

Read More

Kubernetes ConfigMaps

It’s common for applications to require some kind of configuration. These configurations make it easy to change settings depending on the environment where the application is running.

For example, we might want to connect to a back-end server when running in a testing environment, but to a different one when running in production. An application might read these settings from environment variables, configuration files, or other means.

ConfigMaps are a way to make configurations available to pods so they can be used by our applications.

Read More