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

fix(docs): Miscellaneous fixes to docs #70

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 3 additions & 51 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ retina-capture-workload: ## build the Retina capture workload
##@ Containers

IMAGE_REGISTRY ?= ghcr.io
IMAGE_NAMESPACE ?= $(shell git config --get remote.origin.url | sed -E 's/.*github\.com[\/:]([^\/]+)\/([^\/.]+).git/\1\/\2/')
IMAGE_NAMESPACE ?= $(shell git config --get remote.origin.url | sed -E 's/.*github\.com[\/:]([^\/]+)\/([^\/.]+).git/\1\/\2/' | tr '[:upper:]' '[:lower:]')

RETINA_BUILDER_IMAGE = $(IMAGE_NAMESPACE)/retina-builder
RETINA_TOOLS_IMAGE = $(IMAGE_NAMESPACE)/retina-tools
Expand Down Expand Up @@ -395,7 +395,7 @@ coverage: # Code coverage.
manifests:
cd crd && make manifests && make generate

HELM_IMAGE_TAG ?= v0.0.1-pre.1
HELM_IMAGE_TAG ?= v0.0.1

# basic/node-level mode
helm-install: manifests
Expand Down Expand Up @@ -447,8 +447,7 @@ helm-install-advanced-local-context: manifests
--skip-crds \
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\,packetparser\]" \
--set enablePodLevel=true \
--set enableAnnotations=true \
--set bypassLookupIPOfInterest=false
--set enableAnnotations=true

helm-uninstall:
helm uninstall retina -n kube-system
Expand All @@ -461,50 +460,3 @@ docs:
.PHONY: docs-pod
docs-prod:
docker run -i -p 3000:3000 -v $(PWD):/retina -w /retina/ node:20-alpine npm install --prefix site && npm run build --prefix site

# Kapinger is a tool to generate traffic for testing Retina.

kapinger-image: ## build the retina container image.
echo "Building for $(PLATFORM)"
$(MAKE) container-$(CONTAINER_BUILDER) \
PLATFORM=$(PLATFORM) \
DOCKERFILE=hack/tools/kapinger/Dockerfile \
REGISTRY=$(IMAGE_REGISTRY) \
IMAGE=$(KAPINGER_IMAGE) \
VERSION=$(TAG) \
TAG=$(RETINA_PLATFORM_TAG) \
APP_INSIGHTS_ID=$(APP_INSIGHTS_ID) \
CONTEXT_DIR=$(REPO_ROOT) \
ACTION=--load

kapinger-image-push:
$(MAKE) container-push \
IMAGE=$(KAPINGER_IMAGE) \
TAG=$(RETINA_PLATFORM_TAG)

kapinger-manifest-create:
$(MAKE) manifest-create \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(KAPINGER_IMAGE) \
TAG=$(TAG)

kapinger-manifest-push:
$(MAKE) manifest-push \
IMAGE=$(KAPINGER_IMAGE) \
TAG=$(TAG)

kapinger-image-win-push:
$(MAKE) container-$(CONTAINER_BUILDER) \
PLATFORM=windows/amd64 \
DOCKERFILE=hack/tools/kapinger/Dockerfile.windows \
REGISTRY=$(IMAGE_REGISTRY) \
IMAGE=$(KAPINGER_IMAGE) \
VERSION=$(TAG) \
TAG=$(RETINA_PLATFORM_TAG) \
CONTEXT_DIR=$(REPO_ROOT) \
ACTION=--push

kapinger-skopeo-archive:
$(MAKE) manifest-skopeo-archive \
IMAGE=$(KAPINGER_IMAGE) \
TAG=$(TAG)
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,30 @@ Prerequisites: Go, Helm

2. Follow steps in [Capture CRD](https://retina.sh/docs/captures/#option-2-capture-crd-custom-resource-definition) for documentation of the CRD and examples for setting up Captures.

#### CLI Setup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is duplicated from above in the README


Currently, Retina CLI only supports Linux.

For CLI usage, see [Capture with Retina CLI](../captures/cli.md).

#### Option 1: Download from Release

Download `kubectl-retina` from the latest [Retina release](https://github.com/microsoft/retina/releases).
Feel free to move the binary to `/usr/local/bin/`, or add it to your `PATH` otherwise.

#### Option 2: Build from source

Clone the Retina repo and execute:

```shell
make install-kubectl-retina
```

Requirements:

- go 1.21 or newer
- GNU make

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down
43 changes: 15 additions & 28 deletions docs/contributing/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export LLVM_VERSION=14
curl -sL https://apt.llvm.org/llvm.sh | sudo bash -s "$LLVM_VERSION"
```

Download [Helm](https://helm.sh/) as well.
- Download [Helm](https://helm.sh/)
- Fork the repository
- If you want to use [ghcr.io](https://github.com/features/packages) as container registry, login following instructions [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic)

### Test

Expand All @@ -80,7 +82,8 @@ make retina
To build a `retina-agent` container image with specific tag:

```bash
TAG=<tag> make retina-image
make retina-image # also pushes to image registy
make retina-operator-image
```

To build binary of a plugin and test it
Expand All @@ -101,19 +104,10 @@ debug packetforward Received PacketForward data {"Data": "IngressBytes:8
...
```

### Deploying Locally on Kind

```bash
make kind-setup # This deploys a Kind cluster and installs azure NPM
make retina-image && make kind-install # Skip building image if already done
make kind-clean # Delete Kind cluster
```

### Deploying on Other Kubernetes Cluster
### Deploying on Kubernetes Cluster

1. Create Kubernetes cluster.
2. Build and push the docker image for Retina: `make retina-image-push IMAGE_REGISTRY=<your-image-registry>`
3. Install Retina: `make helm-install IMAGE_REGISTRY=<your-image-registry>`
2. Install Retina: `make helm-install`

### Verify Deployment

Expand Down Expand Up @@ -152,20 +146,13 @@ anubhab 614516 0.0 0.1 759000 41796 pts/3 Sl+ 14:34 0:00 kubectl port-
$
$ curl http://localhost:9090/metrics | grep retina
...
# HELP retina_drop_bytes Total dropped bytes
# TYPE retina_drop_bytes gauge
retina_drop_bytes{direction="unknown",reason="IPTABLE_RULE_DROP"} 480
# HELP retina_drop_count Total dropped packets
# TYPE retina_drop_count gauge
retina_drop_count{direction="unknown",reason="IPTABLE_RULE_DROP"} 12
# HELP retina_forward_bytes Total forwarded bytes
# TYPE retina_forward_bytes gauge
retina_forward_bytes{direction="egress"} 1.28357355e+08
retina_forward_bytes{direction="ingress"} 3.9520696e+08
# HELP retina_forward_count Total forwarded packets
# TYPE retina_forward_count gauge
retina_forward_count{direction="egress"} 126462
retina_forward_count{direction="ingress"} 156793
networkobservability_drop_bytes{direction="unknown",reason="IPTABLE_RULE_DROP"} 480
networkobservability_drop_count{direction="unknown",reason="IPTABLE_RULE_DROP"} 12
networkobservability_forward_bytes{direction="egress"} 1.28357355e+08
networkobservability_forward_bytes{direction="ingress"} 3.9520696e+08
networkobservability_forward_count{direction="egress"} 126462
networkobservability_forward_count{direction="ingress"} 156793
...
```

### Dashboard/Prometheus/Grafana
Expand All @@ -182,7 +169,7 @@ Documentation for these technologies:
Uninstall `Retina`:

```bash
helm uninstall retina -n kube-system
make helm-uninstall
```

## Contact
Expand Down
11 changes: 6 additions & 5 deletions docs/installation/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

## Pre-Requisites

Follow either:

- [Unmanaged Prometheus/Grafana](./prometheus-unmanaged.md) or
- [Azure-Hosted Prometheus/Grafana](prometheus-azure-managed.md).

Make sure that you're still port-forwarding your server to localhost:9090, or configure your server for some other HTTP endpoint.

Port-forward svc/prometheus-grafana to access from local browser.

## Configuration

1. Check Grafana to make sure the managed Prometheus datasource exists:
Expand All @@ -19,15 +18,17 @@ Make sure that you're still port-forwarding your server to localhost:9090, or co

![alt text](img/grafana-dashboard-import.png)

3. Import the [published dashboards](https://grafana.com/grafana/dashboards/) by ID, or import the dashboards by JSON at *deploy/grafana/dashboards/*.
3. Import the [published dashboards](https://grafana.com/grafana/dashboards/) by ID [18814](https://grafana.com/grafana/dashboards/18814-kubernetes-networking-clusters/)

4. The Grafana dashboard should now be visible.

![alt text](img/grafana-dashboard.png)

## Pre-Installed Dashboards

If you're using [Azure-Hosted Prometheus/Grafana](prometheus-azure-managed.md), versions of these dashbaords are pre-installed under:
ID: [18814](https://grafana.com/grafana/dashboards/18814-kubernetes-networking-clusters/)

If you're using above, versions of these dashbaords are pre-installed under:

- Dashboards > Managed Prometheus > Kubernetes / Networking / Clusters
- Dashboards > Managed Prometheus > Kubernetes / Networking / DNS
81 changes: 0 additions & 81 deletions docs/installation/prometheus-azure-managed.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/installation/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,4 @@ make helm-install-advanced-local-context

## Next Steps: Configuring Prometheus/Grafana

Follow the guide relevant to your setup:

- [Unmanaged Prometheus/Grafana](./prometheus-unmanaged.md)
- [Azure-Hosted Prometheus/Grafana](./prometheus-azure-managed.md)

## Managed Solutions

For a managed experience, eliminating the need to manage helm charts, see these options:

- [Azure-Managed Installation](https://learn.microsoft.com/en-us/azure/aks/network-observability-managed-cli?tabs=non-cilium)
2 changes: 1 addition & 1 deletion docs/metrics/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Annotations let you specify which Pods to observe (create metrics for).
To configure this, specify `enableAnnotations=true` in Retina's [helm installation](../installation/setup.md) or [ConfigMap](../installation/config.md).

You can then add the annotation `retina.sh/v1alpha1: observe` to either:
You can then add the annotation `retina.sh: observe` to either:

- individual Pods
- Namespaces (to observe all the Pods in the namespace).
Expand Down
12 changes: 0 additions & 12 deletions hack/tools/kapinger/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions hack/tools/kapinger/Dockerfile.windows

This file was deleted.

Loading
Loading