Skip to content

Commit

Permalink
Merge pull request #183 from fasaxc/mark-ga
Browse files Browse the repository at this point in the history
Mark Typha GA, update readme
  • Loading branch information
tomdee authored Aug 9, 2018
2 parents f7fce4c + e1e5378 commit 7daf106
Showing 1 changed file with 12 additions and 109 deletions.
121 changes: 12 additions & 109 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Note that the documentation in this repo is targeted at Calico contributors.
</blockquote>
-->

This repository contains the source code for Project Calico's optional Typha daemon, which is
currently in beta. An instance of Typha sits between the datastore (such as the
Kubernetes API server) and many instances of Felix.
This repository contains the source code for Project Calico's optional Typha daemon. An instance of Typha sits
between the datastore (such as the Kubernetes API server) and many instances of Felix.

![A small cluster of Typha nodes fan out updates to many Felix instances](docs/fan-out.png "A small cluster of Typha nodes fan out updates to many Felix instances ")

Expand All @@ -23,115 +22,19 @@ This has many advantages:
by a large factor.

- Since Typha can filter out updates that are not relevant to Felix, it also reduces Felix's
CPU usage. In a high-scale (100+ node) Kubernetes cluster, this is essential because the
CPU usage. In a high-scale (100+ node) Kubernetes cluster, this is _essential_ because the
number of updates generated by the API server scales with the number of nodes.

## How can I try Typha?

We're still in the process of adding Typha to our documentation. In the meantime, if you're

- using the Kubernetes Datastore Driver (KDD)
- with Kubernetes 1.6+
- with RBAC disabled (or you're comfortable adding a service account for Typha!)

and you'd like to try it out, follow the instructions below...

Since Typha has the most impact when using the KDD, we're focusing on that to begin with. Install the Kubernetes
specs below to create a 3-node deployment of Typha and expose them as a service called `calico-typha`. A three-node
deployment is enough for ~600 Felix instances. Typha scales horizontally so feel free to reduce/increase
the number of replicas. If you're running a small cluster, you may wish to reduce the CPU reservation
proportionately.


apiVersion: v1
kind: Service
metadata:
name: calico-typha
namespace: kube-system
labels:
k8s-app: calico-typha
spec:
ports:
- port: 5473
protocol: TCP
targetPort: calico-typha
name: calico-typha
selector:
k8s-app: calico-typha
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: calico-typha
namespace: kube-system
labels:
k8s-app: calico-typha
spec:
replicas: 3
revisionHistoryLimit: 2
template:
metadata:
labels:
k8s-app: calico-typha
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
hostNetwork: true
containers:
- image: calico/typha:v0.2.2
name: calico-typha
ports:
- containerPort: 5473
name: calico-typha
protocol: TCP
env:
- name: TYPHA_LOGFILEPATH
value: "none"
- name: TYPHA_LOGSEVERITYSYS
value: "none"
- name: TYPHA_LOGSEVERITYSCREEN
value: "info"
- name: TYPHA_PROMETHEUSMETRICSENABLED
value: "true"
- name: TYPHA_PROMETHEUSMETRICSPORT
value: "9093"
- name: TYPHA_DATASTORETYPE
value: "kubernetes"
- name: TYPHA_CONNECTIONREBALANCINGMODE
value: "kubernetes"
volumeMounts:
- mountPath: /etc/calico
name: etc-calico
readOnly: true
resources:
requests:
cpu: 1000m
volumes:
# Mount in the Calico config directory from the host.
- name: etc-calico
hostPath:
path: /etc/calico


Once you have a Typha service running, you can tell Felix `v2.3.0+` (`calico/node:v1.3.0+`) to connect
to it by setting the following environment variable in your calico/node pod spec, which tells
Felix to discover Typha using the Kubernetes service API:


- name: FELIX_TYPHAK8SSERVICENAME
value: "calico-typha"


**Note**:

- You must also configure Felix with direct datastore access (using the same datastore as Typha!),
since Felix needs to connect to the datastore itself to load its configuration before it connects
to Typha. If Felix was working before adding the above environment variable, you should be good to go.
## When should I use Typha?

We recommend using Typha only if you're using the Kubernetes API Datastore and you have more than 50
Kubernetes nodes. While Typha can be used with etcd, etcd v3 is optimised to handle many clients
already so we do not recommend adding Typha if you're using etcd.

## How can I start using Typha?

Follow the "more than 50 nodes" section in the
[Calico for Kubernetes getting started guide](https://docs.projectcalico.org/latest/getting-started/kubernetes/installation/calico).

## How can I get support for contributing to Project Calico?

Expand Down Expand Up @@ -179,7 +82,7 @@ make bin/calico-typha
```
or, the `calico/typha` docker image:
```
make calico/typha
make image
```

## How can I run Typha's unit tests?
Expand Down

0 comments on commit 7daf106

Please sign in to comment.