# Get Started

% NOTE: Keep this content in sync with the top-level README.md file.

GitHub Actions, via this project's
[Continuous Delivery](https://github.com/ibrsp/ndcp-dev-meta/actions/workflows/cd.yaml)
workflow, automates deployments, but if necessary, follow these
instructions to deploy the project manually.

## Required Software

Install and configure the following software before deploying
the components of this project.

[Docker](https://docs.docker.com/get-started/get-docker/)
: Docker is an open platform for developing, shipping, and running applications.
  Docker allows you to separate your applications from your infrastructure so you
  can deliver software quickly. With Docker, you can manage your infrastructure in the
  same ways you manage your applications.

:::{admonition} Guidance

Manual deployers only need Docker if they need to push updated images to the
[cortex-meta OCI image registry](https://zot.cluster.ibrst.org/home).

:::

[Git](https://git-scm.com/)
: Tracks changes to source code or data, with support for distributed,
  non-linear workflows.  Deployers need read access to the referenced
  Git repositories.  When using SSH to connect to private remote
  repositories, set
  [`url.<base>.insteadOf`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlbaseinsteadOf)
  in the
  [global Git configuration](https://git-scm.com/docs/git-config#Documentation/git-config.txt-gitconfig)
  to transparently map HTTPS URLs used by this project to SSH URLs.

[Helm](https://helm.sh/docs/intro/install/)
: Helm helps you manage Kubernetes applications. Helm Charts help you define,
  install, and upgrade even the most complex Kubernetes application.

[Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
: The Kubernetes command-line tool, kubectl, allows you to run commands
  against Kubernetes clusters. You can use
  [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/)
  to deploy applications,
  inspect and manage cluster resources, and view logs.

  Deployers need
  [administrator access](https://TBD)
  to the target Kubernetes cluster.  Refer to the
  [Cortex-meta documentation](https://TBD)
  for authentication and configuration guidance.  Note that this
  project deploys resources in
  [RENU data center](https://renu.ac.ug/colocation/)
  by default.

## Manual Deployment Procedure

1. Clone this GitHub repository.  Alternatively, download and unpack
   the latest release.

2. If the LDAP and Discovery images are not available in the
   [cortex-meta OCI image registry](https://zot.cluster.ibrst.org/home),
   build and push them to the registry.

```sh
docker build --platform linux/amd64 \
  -f charts/cortex/config/discovery/image/Dockerfile.httpd \
  -t zot.cluster.ibrst.org/cortex/httpd:2.4.67 \
  charts/cortex/config/discovery/image \
  && docker push zot.cluster.ibrst.org/cortex/httpd:2.4.67
```

3. Download the
   [kubernetes cluster config](https://start.1password.com/open/i?a=MNHI7ZMUQNG2THZQ3QQR6MH5JI&v=i2m5jhdnppz4tuhszjxapqojfi&i=u4el3irpbluoxfimsr3t2vmpyi&h=ibrsp.1password.com)
   from the credential vault, saving it to your kubernetes configuration file e.g `~/.kube/config`.

4. Download the
   [chart values](https://start.1password.com/open/i?a=MNHI7ZMUQNG2THZQ3QQR6MH5JI&v=i2m5jhdnppz4tuhszjxapqojfi&i=u4el3irpbluoxfimsr3t2vmpyi&h=ibrsp.1password.com)
   from the credential vault, saving it to the project root
   directory.

5. Install or upgrade the CORTEX Helm chart to deploy the platform components.

   ```sh
   helm upgrade --install cortex charts/cortex \
   -n cortex-dev --create-namespace \
   -f my-values.yaml
   ```
