Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Closes jaegertracing#74 - Changed Kubernetes Template to use DaemonSet
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed Mar 22, 2018
1 parent f91dedd commit ec38c01
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,48 @@ If changes are required for the configuration, the `edit` command can be used:

### Jaeger components

The main production template deploys the Collector and the Query Service (with UI) as separate individually scalable services.
The main production template deploys the Collector and the Query Service (with UI) as separate individually scalable services,
as well as the Agent as `DaemonSet`.

kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/jaeger-production-template.yml

If the backing storage is not ready by the time the Collector/Agent start, they will fail and Kubernetes will reschedule the
pod. It's advisable to either wait for the backing storage to stabilize, or to ignore such failures for the first few minutes.

Once everything is ready, `kubectl get service jaeger-query` tells you where to find Jaeger URL, or
`minikube service jaeger-query --url` when using `minikube`
`minikube service jaeger-query --url` when using `minikube`.

As the agent is deployed as a `DaemonSet`, the node's IP address can be stored as an environment variable and passed down
to the application as:

```yaml
env:
- name: JAEGER_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
```
### Deploying the agent as sidecar
The Jaeger Agent is designed to be deployed local to your service, so that it can receive traces via UDP keeping your
application's load minimal. As such, it's ideal to have the Agent to be deployed as a sidecar to your application's component,
just add it as a container within any struct that supports `spec.containers`, like a `Pod`, `Deployment` and so on.
application's load minimal. By default, the template above installs the agent as a `DaemonSet`, but this means that all
pods running on a given node will send data to the same agent. If that's not suitable for your workload, an alternative
is to deploy the agent as a sidecar. To accomplish that, just add it as a container within any struct that supports
`spec.containers`, like a `Pod`, `Deployment` and so on. More about this be found on the blog post
[Deployment strategies for the Jaeger Agent](https://medium.com/jaegertracing/deployment-strategies-for-the-jaeger-agent-1d6f91796d09).

For instance, assuming that your application is named `myapp` and the image is for it is `mynamespace/hello-myimage`, your
Assuming that your application is named `myapp` and the image is for it is `mynamespace/hello-myimage`, your
`Deployment` descriptor would be something like:

```yaml
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
Expand Down
39 changes: 39 additions & 0 deletions jaeger-production-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,42 @@ items:
selector:
jaeger-infra: query-pod
type: LoadBalancer
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: jaeger-agent
labels:
app: jaeger
jaeger-infra: agent-daemonset
spec:
template:
metadata:
labels:
app: jaeger
jaeger-infra: agent-instance
spec:
containers:
- name: agent-instance
image: jaegertracing/jaeger-agent:1.2
command:
- "/go/bin/agent-linux"
- "--config-file=/conf/agent.yaml"
volumeMounts:
- name: jaeger-configuration-volume
mountPath: /conf
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
volumes:
- configMap:
name: jaeger-configuration
items:
- key: agent
path: agent.yaml
name: jaeger-configuration-volume
3 changes: 3 additions & 0 deletions production-elasticsearch/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ data:
password: changeme
query:
static-files: /go/jaeger-ui/
agent: |
collector:
host-port: "jaeger-collector:14267"
3 changes: 3 additions & 0 deletions production/configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ data:
keyspace: jaeger_v1_dc1
query:
static-files: /go/jaeger-ui/
agent: |
collector:
host-port: "jaeger-collector:14267"

0 comments on commit ec38c01

Please sign in to comment.