Part 3 - configuration options in a production setup

This contains instructions to improve production setup depending on your needs.

Depending on your use-case and requirements, you may only need to configure none, or only a subset of the following sections.

Warning

As of 2019-10-15, this documentation section is partially out of date and needs to be updated.

You may want

  • more server resources to ensure high-availability

  • an email/SMTP server to send out registration emails

  • depending on your required functionality, you may or may not need an AWS account. See details about limitations without an AWS account in the following sections.

  • one or more people able to maintain the installation

  • official support by Wire (contact us)

SMTP server

Assumptions: none

Provides:

  • full control over email sending

You need:

  • SMTP credentials (to allow for email sending; prerequisite for registering users and running the smoketest)

How to configure:

  • if using a gmail account, ensure to enable ‘less secure apps’

  • Add user, SMTP server, connection type to values/wire-server’s values file under brig.config.smtp

  • Add password in secrets/wire-server’s secrets file under brig.secrets.smtpPassword

Load balancer on bare metal servers

Assumptions:

Provides:

  • Allows using a provided Load balancer for incoming traffic

  • SSL termination is done on the ingress controller

  • You can access your wire-server backend with given DNS names, over SSL and from anywhere in the internet

You need:

  • A kubernetes node with a public IP address (or internal, if you do not plan to expose the Wire backend over the Internet but we will assume you are using a public IP address)

  • DNS records for the different exposed addresses (the ingress depends on the usage of virtual hosts), namely:

    • nginz-https.<domain>

    • nginz-ssl.<domain>

    • assets.<domain>

    • webapp.<domain>

    • account.<domain>

    • teams.<domain>

  • A wildcard certificate for the different hosts (*.<domain>) - we assume you want to do SSL termination on the ingress controller

Caveats:

  • Note that there can be only a single load balancer, otherwise your cluster might become unstable

How to configure:

cp values/metallb/demo-values.example.yaml values/metallb/demo-values.yaml
cp values/nginx-lb-ingress/demo-values.example.yaml values/nginx-lb-ingress/demo-values.yaml
cp values/nginx-lb-ingress/demo-secrets.example.yaml values/nginx-lb-ingress/demo-secrets.yaml
  • Adapt values/metallb/demo-values.yaml to provide a list of public IP address CIDRs that your kubernetes nodes can bind to.

  • Adapt values/nginx-lb-ingress/demo-values.yaml with correct URLs

  • Put your TLS cert and key into values/nginx-lb-ingress/demo-secrets.yaml.

Install metallb (for more information see the docs):

helm upgrade --install --namespace metallb-system metallb wire/metallb \
    -f values/metallb/demo-values.yaml \
    --wait --timeout 1800

Install nginx-lb-ingress:

helm upgrade --install --namespace demo demo-nginx-lb-ingress wire/nginx-lb-ingress \
    -f values/nginx-lb-ingress/demo-values.yaml \
    -f values/nginx-lb-ingress/demo-secrets.yaml \
    --wait

Now, create DNS records for the URLs configured above.

Load Balancer on cloud-provider

AWS

Upload the required certificates. Create and configure values/aws-ingress/demo-values.yaml from the examples.

helm upgrade --install --namespace demo demo-aws-ingress wire/aws-ingress \
    -f values/aws-ingress/demo-values.yaml \
    --wait

To give your load balancers public DNS names, create and edit values/external-dns/demo-values.yaml, then run external-dns:

helm repo update
helm upgrade --install --namespace demo demo-external-dns stable/external-dns \
    --version 1.7.3 \
    -f values/external-dns/demo-values.yaml \
    --wait

Things to note about external-dns:

  • There can only be a single external-dns chart installed (one per kubernetes cluster, not one per namespace). So if you already have one running for another namespace you probably don’t need to do anything.

  • You have to add the appropriate IAM permissions to your cluster (see the README).

  • Alternatively, use the AWS route53 console.

Other cloud providers

This information is not yet available. If you’d like to contribute by adding this information for your cloud provider, feel free to read the contributing guidelines and open a PR.

Real AWS services

Assumptions:

  • You installed kubernetes and wire-server on AWS

Provides:

  • Better availability guarantees and possibly better functionality of AWS services such as SQS and dynamoDB.

  • You can use ELBs in front of nginz for higher availability.

  • instead of using a smtp server and connect with SMTP, you may use SES. See configuration of brig and the useSES toggle.

You need:

  • An AWS account

How to configure:

  • Instead of using fake-aws charts, you need to set up the respective services in your account, create queues, tables etc. Have a look at the fake-aws-* charts; you’ll need to replicate a similar setup.

    • Once real AWS resources are created, adapt the configuration in the values and secrets files for wire-server to use real endpoints and real AWS keys. Look for comments including if using real AWS.

  • Creating AWS resources in a way that is easy to create and delete could be done using either terraform or pulumi. If you’d like to contribute by creating such automation, feel free to read the contributing guidelines and open a PR.

Persistence and high-availability

Currently, due to the way kubernetes and cassandra interact, cassandra cannot reliably be installed on kubernetes. Some people have tried, e.g. this project though at the time of writing (Nov 2018), this does not yet work as advertised. We recommend therefore to install cassandra, (possibly also elasticsearch and redis) separately, i.e. outside of kubernetes (using 3 nodes each).

For further higher-availability:

  • scale your kubernetes cluster to have separate etcd and master nodes (3 nodes each)

  • use 3 instead of 1 replica of each wire-server chart

Security

For a production deployment, you should, as a minimum:

  • Ensure traffic between kubernetes nodes, etcd and databases are confined to a private network

  • Ensure kubernetes API is unreachable from the public internet (e.g. put behind VPN/bastion host or restrict IP range) to prevent kubernetes vulnerabilities from affecting you

  • Ensure your operating systems get security updates automatically

  • Restrict ssh access / harden sshd configuration

  • Ensure no other pods with public access than the main ingress are deployed on your cluster, since, in the current setup, pods have access to etcd values (and thus any secrets stored there, including secrets from other pods)

  • Ensure developers encrypt any secrets.yaml files

Additionally, you may wish to build, sign, and host your own docker images to have increased confidence in those images. We haved “signed container images” on our roadmap.

Sign up with a phone number (Sending SMS)

Provides:

  • Registering accounts with a phone number

You need:

How to configure:

See the brig chart for configuration.

3rd-party proxying

You need Giphy/Google/Spotify/Soundcloud API keys (if you want to support previews by proxying these services)

See the proxy chart for configuration.