|
| 1 | +# GNP-Stack |
| 2 | + |
| 3 | +You can deploy the GNP-Stack either via Docker Compose on a single container host for small setups, or via the Helm chart on a Kubernetes cluster if you need more scalability and resilience. |
| 4 | + |
| 5 | +## Docker Compose Deployment |
| 6 | +```bash |
| 7 | +git clone https://github.com/fatred/gnp-stack.git |
| 8 | +cd gnp-stack |
| 9 | +docker-compose up -d |
| 10 | +``` |
| 11 | + |
| 12 | +### Configuration |
| 13 | +You can customize the deployment by modifying the `docker-compose.yml` file before starting the stack. |
| 14 | +You can find the configuration files for each component in the following directories: |
| 15 | +- gNMIc ingestor: `gnmic/` |
| 16 | +- gNMIc emitter: `gnmic/` |
| 17 | +- NATS: `nats/` |
| 18 | +- Prometheus: `prometheus/` |
| 19 | +- Grafana: `grafana/` |
| 20 | + |
| 21 | +## Kubernetes Deployment |
| 22 | +### Prerequisites |
| 23 | +Following prerequisites are required to install the GNP-Stack: |
| 24 | +- A running Kubernetes cluster (v1.28+) |
| 25 | +- Helm |
| 26 | +- Container Storage Interface (CSI) plugin for persistent storage (optional, if you have one set localPathProvisioner.enabled=false) |
| 27 | +- Prometheus Operator CRDs (optional, if you want to monitor your observability stack) |
| 28 | + |
| 29 | +Helm >= 3 is required to install the GNP-Stack on Kubernetes. |
| 30 | +You can install Helm by following the instructions in the [Helm documentation](https://helm.sh/docs/intro/install/) |
| 31 | + |
| 32 | +To install the Prometheus Operator CRDs: |
| 33 | +```bash |
| 34 | +helm upgrade -i prometheus-crds oci://ghcr.io/prometheus-community/charts/prometheus-operator-crds --version 23.0.0 |
| 35 | +``` |
| 36 | + |
| 37 | +### Install GNP-Stack |
| 38 | +Install gnp-stack: |
| 39 | +```bash |
| 40 | +helm upgrade --install gnp-stack oci://ghcr.io/untersander/gnp-stack/gnp-stack --namespace gnp-stack --create-namespace |
| 41 | +``` |
| 42 | + |
| 43 | +### Configuration |
| 44 | +You can customize the deployment by creating a `values.yaml` file before installing the Helm chart and passing it with the `-f` flag: |
| 45 | +```bash |
| 46 | +helm upgrade --install gnp-stack oci://ghcr.io/untersander/gnp-stack/gnp-stack --namespace gnp-stack --create-namespace -f values.yaml |
| 47 | +``` |
| 48 | + |
| 49 | +You can override parameters for each component of the gnp-stack, such as gNMIc ingestor/emitter, NATS, Prometheus, and Grafana. |
| 50 | + |
| 51 | +Take a look at the default [values.yaml](https://github.com/untersander/gnp-stack/blob/main/install/kubernetes/gnp-stack/values.yaml) file for all available configuration options. |
| 52 | + |
| 53 | + |
| 54 | +### Accessing the Grafana Dashboard |
| 55 | +The easiest way to access the Grafana dashboard is to use port forwarding: |
| 56 | +```bash |
| 57 | +kubectl port-forward -n gnp-stack svc/gnp-stack-grafana 3000:80 |
| 58 | +``` |
| 59 | +You can then access Grafana by navigating to `http://localhost:3000` in your web browser. |
| 60 | +The default login credentials are: |
| 61 | +- Username: `admin` |
| 62 | +- Password: `gnp-stack` |
| 63 | + |
| 64 | +### Setup Demo Cluster |
| 65 | + |
| 66 | +Using [talosctl](https://docs.siderolabs.com/talos/v1.11/getting-started/talosctl), you can quickly set up a local Kubernetes cluster for testing and development purposes. |
| 67 | +```bash |
| 68 | +talosctl cluster create --cidr 192.168.60.0/24 --name gnp-stack_gnp-mgmt --wait=false --config-patch '{"cluster":{"network":{"cni":{"name":"none"}},"proxy":{"disabled":true}}}' --cpus-workers 6.0 --memory-workers 8000 |
| 69 | +``` |
| 70 | + |
| 71 | +To get the kubeconfig for the cluster, run: |
| 72 | +```bash |
| 73 | +talosctl kubeconfig kubeconfig -m -n 192.168.60.2 |
| 74 | +``` |
| 75 | + |
| 76 | +Cilium installation: |
| 77 | +```bash |
| 78 | +helm repo add cilium https://helm.cilium.io |
| 79 | +helm repo update |
| 80 | +helm upgrade --install cilium cilium/cilium \ |
| 81 | + --version 1.18.5 \ |
| 82 | + --namespace kube-system \ |
| 83 | + --values - <<'EOF' |
| 84 | +ipam: |
| 85 | + mode: kubernetes |
| 86 | +kubeProxyReplacement: true |
| 87 | +securityContext: |
| 88 | + capabilities: |
| 89 | + ciliumAgent: [CHOWN, KILL, NET_ADMIN, NET_RAW, IPC_LOCK, SYS_ADMIN, SYS_RESOURCE, DAC_OVERRIDE, FOWNER, SETGID, SETUID] |
| 90 | + cleanCiliumState: [NET_ADMIN, SYS_ADMIN, SYS_RESOURCE] |
| 91 | +cgroup: |
| 92 | + autoMount: |
| 93 | + enabled: false |
| 94 | + hostRoot: /sys/fs/cgroup |
| 95 | +k8sServiceHost: localhost |
| 96 | +k8sServicePort: 7445 |
| 97 | +EOF |
| 98 | +``` |
| 99 | + |
| 100 | +### Cleanup demo cluster |
| 101 | +```bash |
| 102 | +talosctl cluster destroy --name gnp-stack_gnp-mgmt |
0 commit comments