Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added reference to helm chart usage on core,horizon install #216

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
30 changes: 29 additions & 1 deletion docs/run-api-server/installing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ To install Horizon, you have a few choices. You can...
- install prebuilt binaries [from our repositories](#package-manager) via your package manager if running a Debian-based system,
- download a [prebuilt release](https://github.com/stellar/go/releases/latest) of Horizon for your target architecture and operation system, or
- [build Horizon and Stellar Core yourself](#building) from scratch.
- use [horizon helm chart](https://github.com/stellar/helm-charts/blob/main/charts/horizon/README.md) which internally uses same prebuilt binary in the runtime image.

**The first method is recommended**: Not only do you ensure OS compatibility and dependency management, you'll also install some convenient wrappers that make running Horizon and Stellar Core in their respective environments much simpler.
**prebuilt binaries method is recommended**: Not only do you ensure OS compatibility and dependency management, you'll also install some convenient wrappers that make running Horizon and Stellar Core in their respective environments much simpler.
sreuland marked this conversation as resolved.
Show resolved Hide resolved

## Installation Methods

Expand All @@ -28,6 +29,33 @@ sudo apt install stellar-horizon stellar-core

</CodeExample>

## Helm Chart Installation

If the deployment can be done on Kubernetes, there is a [horizon helm chart](https://github.com/stellar/helm-charts/blob/main/charts/horizon) available. Install the [Helm cli tool](https://helm.sh/docs/intro/install/), minimum of version 3, if you haven't already on your workstation. Next, add the Stellar repo to the helm client's list of repos and view available chart versions:

<CodeExample>

```bash
helm repo add stellar https://helm.stellar.org/charts
helm repo update stellar
helm search repo stellar/horizon --versions --devel
```

</CodeExample>

Don't install the horizon helm chart yet, it will be done in [Running](./running.mdx), but you should review [Configuring](./configuring.mdx) first to be aware of all the potential horizon configuration parameters which the chart auto-configures by default.

If kubernetes is not an option, the helm charts may still be good reference for showing how to configure and run the horizon docker container. Just run the helm command with `template` to display the generated kubeneretes manifests which demonstrate all the container configurations needed:

<CodeExample>

```bash
git clone https://github.com/stellar/helm-charts; cd helm-charts
helm template -f charts/horizon/values.yaml charts/horizon/
```

</CodeExample>

Next, you can jump to [Testing Your Installation](#completing-and-testing-your-installation).

### Building
Expand Down
63 changes: 62 additions & 1 deletion docs/run-api-server/running.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,68 @@ sidebar_position: 40

import { CodeExample } from "@site/src/components/CodeExample";

Once your Horizon database and Captive Core configuration is set up properly, you're ready to run Horizon. Run `stellar-horizon` with the [appropriate parameters](./configuring.mdx#parameters) set (or `stellar-horizon-cmd serve` if you [installed via the package manager](./installing.mdx#package-manager), which will automatically import your configuration from `/etc/default/stellar-horizon`), which starts the HTTP server and starts logging to standard out. When run, you should see output similar to:
Once your Horizon database and Captive Core configuration is set up properly, you're ready to run Horizon.

To run `stellar-horizon` binary direct with the [appropriate parameters](./configuring.mdx#parameters) set (or `stellar-horizon-cmd serve` if you [installed via the package manager](./installing.mdx#package-manager), which will automatically import your configuration from `/etc/default/stellar-horizon`).

To run on Kubernetes using helm chart, ensure you have followed the [pre-requisite](./installing.mdx#helm-chart-installation) of installing the Helm cli tool and adding the Stellar chart repo to helm client.

The horizon process [requires access to a Postgres 12+ database](./configuring.mdx#preparing-the-database), first use the common kubernetes cli tool `kubectl` from your workstation to create a kubernetes secret on the intended namespace of the kubernetes cluster which will hold the horizon database url.

<CodeExample>

```bash
# copy your horizon DATABASE_URL into a secure file, no line breaks.
echo -n 'database_url_here' > my_creds.txt

# now generate the kubernetes secret from the file
kubectl create secret generic \
-n my-namepsace\
my-db-secret \
--from-file=DATABASE_URL=my_creds.txt
```

</CodeExample>

Now deploy horizon onto the cluster using the helm chart, this example includes usage of `--devel` to enable using the latest development version of published helm chart:

<CodeExample>

```bash
helm install my-horizon stellar/horizon \
--namespace my-namespace \
--set ingest.persistence.enabled=true \
--set web.enabled=true \
--set web.existingSecret=my-db-secret \
--set global.image.horizon.tag=2.26.1 \
--set global.network=testnet \
--set ingest.existingSecret=my-db-secret \
--set ingest.horizonConfig.captiveCoreUseDb=true \
--set ingest.resources.limits.cpu=2 \
--set ingest.resources.limits.memory=6Gi \
sreuland marked this conversation as resolved.
Show resolved Hide resolved
--devel
```

</CodeExample>

This example of helm chart usage, shows using the `global.network=[testnet|pubnet]` parameter, this automates generation of all the horizon configuration parameters specific to network such as archive urls, captive core config, etc and other parameters as mentioned on [Configuring](./configuring.mdx). This example also enabled all roles on the deployment instance: ingesting, api, transaction submission. If you want to use a different network other than testnet or pubnet, or customize more of the other settings, the best approach is to checkout locally the [horizon helm chart values.yaml](https://github.com/stellar/helm-charts/blob/main/charts/horizon/values.yaml), update the settings in values.yaml, and pass to install:

<CodeExample>

```bash
helm install myhorizon \
stellar/horizon \
--namespace my-horizon-namespace-on-cluster \
-f values.yaml
```

</CodeExample>

Specific to network configuration parameters, if you want to connect to a network other than testnet or pubnet, then you won't use `global.network`, instead, use the values.yaml locally and set `ingest.coreConfig`, and refer to [\_core-config.tpl](https://github.com/stellar/helm-charts/blob/main/charts/horizon/templates/_core-config.tpl) for example of all the key/value pairs to include.

<br />

Horizon will start HTTP server and logging to standard out. You should see output similar to:

<CodeExample>

Expand Down
29 changes: 28 additions & 1 deletion docs/run-core-node/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Installing
sidebar_position: 30
---

There are three ways to install Stellar Core: you can use a Docker image, use pre-built packages, or build from source. Using a Docker image is the quickest and easiest method, so it's a good choice for a lot of developers, but if you're running Stellar Core in production you may need to use packages or, if you want to sacrifice convenience for maximum control, build from source. Whichever method you use, you should make sure to install the latest [release](https://github.com/stellar/stellar-core/releases) since releases are cumulative and backwards compatible.
There are multiple ways to install Stellar Core: you can use a Docker image, pre-built packages, helm-chart, or build from source. Using the Docker image is the quickest and easiest method, so it's a good choice for a lot of developers, but if you're running Stellar Core in production you should consider the helm chart or packages, if you want to sacrifice convenience for maximum control, build from source. Whichever method you use, you should make sure to install the latest [release](https://github.com/stellar/stellar-core/releases) since releases are cumulative and backwards compatible.
sreuland marked this conversation as resolved.
Show resolved Hide resolved

## Docker-based installation

Expand Down Expand Up @@ -47,6 +47,33 @@ You may choose to install these packages individually, which offers the greatest

Most people, however, choose to install the [stellar-quickstart](https://github.com/stellar/packages/blob/master/docs/quickstart.md) package which configures a **Testnet** `stellar-core` and `stellar-horizon` both backed by a local PostgreSQL database. Once installed you can easily modify either the Stellar Core configuration if you want to connect to the public network.

## Helm Chart Installation

If the deployment can be done on Kubernetes, there is a [core helm chart](https://github.com/stellar/helm-charts/blob/main/charts/core) available. Install the [Helm cli tool](https://helm.sh/docs/intro/install/), minimum of version 3, if you haven't already on your workstation. Next, add the Stellar repo to the helm client's list of repos, and view the available chart versions:

<CodeExample>

```bash
helm repo add stellar https://helm.stellar.org/charts
helm repo update stellar
helm search repo stellar/core --versions --devel
```

</CodeExample>

Don't install the core helm chart yet, it will be done in [Running](./running-node.mdx), but you should review [Configuring](./configuring.mdx) first to be aware of all the potential configuration parameters which can be automatatically set by chart or manually overridden.

If kubernetes is not an option, the helm charts may still be good reference for showing how to configure and run the core docker container. Just run the helm command with `template` to display the generated kubeneretes manifests which demonstrate all the container configurations needed:

<CodeExample>

```bash
git clone https://github.com/stellar/helm-charts; cd helm-charts
helm template -f charts/core/values.yaml charts/core/
```

</CodeExample>

## Installing from source

See the [install from source](https://github.com/stellar/stellar-core/blob/master/INSTALL.md) for build instructions.
Expand Down
25 changes: 24 additions & 1 deletion docs/run-core-node/running-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,33 @@ import { CodeExample } from "@site/src/components/CodeExample";

Once you've [set up your environment](./prerequisites.mdx), [configured your node](./configuring.mdx), set up your [quorum set](./configuring.mdx#choosing-your-quorum-set), and selected archives to `get` [history from](./configuring.mdx#history), you're ready to start Stellar Core.

Use a command equivalent to:
To run the core binary directly, use a command equivalent to:

`$ stellar-core run`

To run the core as a deployment on kubernetes, use the Core Helm Chart:

Ensure you have followed the [pre-requisite](./installation.mdx#helm-chart-installation) of installing the Helm cli tool and adding the Stellar chart repo to helm client, now deploy core to the cluster, showing usage of `--devel` which will use the latest development version of published chart:

<CodeExample>

```bash
helm install testcore stellar/core \
--namespace my-core-namespace-on-cluster \
--set core.persistence.enabled=true \
--set global.image.core.tag=19.13.1-1460.22b9bb384.focal \
--set core.resources.limits.cpu=2 \
--set core.resources.limits.memory=4Gi \
--values testnet-values.yaml
--devel
```

</CodeExample>

This example of helm chart usage, shows using the [testnet-values.yaml](https://github.com/stellar/helm-charts/blob/main/charts/core/testnet-values.yaml) which defines all the configuration parameters specific to network such as archive urls, validators, etc and other parameters as mentioned on [Configuring](./configuring.mdx). Just download that file to your workstation so it can be passed as `--values futurenet-values.yaml`.

Other 'canned' network configurations are provided, `futurenet-values.yaml` and `pubnet-values.yaml`. If you want to override these network settings, or connect to a different network entirely such as a standalone, then edit the local copy of the values.yaml first to align settings to target network.

At this point, you're ready to observe your node's activity as it joins the network.

You may want to skip ahead and review the [logging](#logging) section to familiarize yourself with Stellar Core's output.
Expand Down