Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

Commit

Permalink
SWS-326 - 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 19, 2018
1 parent f91dedd commit abccf95
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 9 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ 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

Expand All @@ -64,18 +65,24 @@ Once everything is ready, `kubectl get service jaeger-query` tells you where to

### 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
79 changes: 75 additions & 4 deletions jaeger-production-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: v1
kind: List
items:
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger-collector
Expand All @@ -24,8 +24,10 @@ items:
jaeger-infra: collector-deployment
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: jaeger
jaeger-infra: collector-pod
template:
metadata:
labels:
Expand Down Expand Up @@ -101,7 +103,7 @@ items:
selector:
jaeger-infra: collector-pod
type: ClusterIP
- apiVersion: extensions/v1beta1
- apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger-query
Expand All @@ -110,6 +112,10 @@ items:
jaeger-infra: query-deployment
spec:
replicas: 1
selector:
matchLabels:
app: jaeger
jaeger-infra: query-pod
strategy:
type: Recreate
template:
Expand Down Expand Up @@ -163,3 +169,68 @@ items:
selector:
jaeger-infra: query-pod
type: LoadBalancer
- apiVersion: apps/v1
kind: DaemonSet
metadata:
name: jaeger-agent
labels:
app: jaeger
jaeger-infra: agent-daemonset
spec:
selector:
matchLabels:
app: jaeger
jaeger-infra: agent-instance
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
volumes:
- configMap:
name: jaeger-configuration
items:
- key: agent
path: agent.yaml
name: jaeger-configuration-volume
- apiVersion: v1
kind: Service
metadata:
name: jaeger-agent
labels:
app: jaeger
jaeger-infra: agent-service
spec:
ports:
- name: zipkin-compact
port: 5775
protocol: UDP
targetPort: 5775
- name: jaeger-compact
port: 6831
protocol: UDP
targetPort: 6831
- name: jaeger-binary
port: 6832
protocol: UDP
targetPort: 6832
selector:
jaeger-infra: agent-instance
type: LoadBalancer
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 abccf95

Please sign in to comment.