# Backend deployment

## Overview

This repository contains the necessary files for deploying the backend application to a kubernetes environment.

## Prerequisites

Before deploying the backend application, ensure that you have the following prerequisites:

- Kubernetes cluster with the following components:
  - ingress controller
  - storage class
- `kubectl` installed (`kustomize` is usually bundled)

## Deployment Steps

### Initial deployment
To deploy the backend application, follow these steps:

1. Clone this repository: `git clone https://github.com/your-repo.git`
1. Apply the kustomization: `kubectl apply -k .`

### Rolling updates
Since the deployment uses the `latest` tag for the backend application, we simply need to trigger a rolling update which will pull the latest image from the registry. To do this, run the following command:

```bash
kubectl -n anyway-backend rollout restart deployment/nav-backend
```


## Configuration

The kustomization allows for easy configuration of the backend application. To customize the deployment, modify the `kustomization.yaml` file.

### Memcached
The backend application requires a memcached instance. By default, the kustomization deploys this instance, as configured under `memcached/`. To disable this, comment out the `memcached` overlay in the `kustomization.yaml` file.