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

WIP: Proof of concept using Loki to store and retrieve logs #1540

Open
wants to merge 13 commits into
base: edu/metal-lb
Choose a base branch
from
12 changes: 10 additions & 2 deletions _run/common-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ PRICE ?= 10uakt
CERT_HOSTNAME ?= localhost
LEASE_SERVICES ?= web

JWT_AUTH_HOSTNAME ?= localhost
JWT_AUTH_HOST ?= $(JWT_AUTH_HOSTNAME):8444
JWT_AUTH_HOSTNAME ?= localhost
JWT_AUTH_HOST ?= $(JWT_AUTH_HOSTNAME):8444
RESOURCE_SERVER_HOST ?= localhost:8445

.PHONY: multisig-send
multisig-send:
Expand Down Expand Up @@ -70,6 +71,13 @@ auth-server:
--from "$(PROVIDER_KEY_NAME)" \
--jwt-auth-listen-address "$(JWT_AUTH_HOST)" \

.PHONY: run-resource-server
run-resource-server:
$(AKASH) provider run-resource-server \
--from "$(PROVIDER_KEY_NAME)" \
--resource-server-listen-address "$(RESOURCE_SERVER_HOST)" \
--loki-gateway-listen-address localhost:3100 \

.PHONY: send-manifest
send-manifest:
$(AKASH) provider send-manifest "$(SDL_PATH)" \
Expand Down
31 changes: 25 additions & 6 deletions _run/common-kind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,46 @@ kind-cluster-create: $(KIND)
--config "$(KIND_CONFIG)" \
--name "$(KIND_NAME)" \
--image "$(KIND_IMG)"
chmod 600 $$HOME/.kube/config
kubectl label nodes $(KIND_NAME)-control-plane akash.network/role=ingress
kubectl apply -f "$(INGRESS_CONFIG_PATH)"
kubectl apply -f "$(INGRESS_CLASS_CONFIG_PATH)"
kubectl apply -f "$(METALLB_CONFIG_PATH)"
kubectl apply -f "$(METALLB_IP_CONFIG_PATH)"
kubectl apply -f "$(METALLB_SERVICE_PATH)"
"$(AKASH_ROOT)/script/setup-kind.sh"
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm upgrade --install loki grafana/loki \
--version 2.9.1 \
--create-namespace \
--namespace loki-stack \
--set config.table_manager.retention_period=48h,config.table_manager.retention_deletes_enabled=true,persistence.enabled=true,persistence.size=10Gi,persistence.storageClassName=standard,config.auth_enabled=true
helm upgrade --install promtail grafana/promtail \
--version 3.11.0 \
--namespace loki-stack \
-f ../promtail-values.yaml


# Create a kubernetes cluster with loki & grafana integrated for logging.
# Create a kubernetes cluster with multi-tenant loki, promtail and grafana integrated for logging.
# See: https://www.scaleway.com/en/docs/tutorials/manage-k8s-logging-loki/ for more info.
.PHONY: kind-cluster-loki-create
kind-cluster-loki-create: kind-cluster-create
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm install loki-stack grafana/loki-stack \
helm upgrade --install loki grafana/loki \
--version 2.9.1 \
--create-namespace \
--namespace loki-stack \
--set promtail.enabled=true,loki.persistence.enabled=true,loki.persistence.size=10Gi
helm install loki-grafana grafana/grafana \
--set persistence.enabled=true,persistence.type=pvc,persistence.size=10Gi \
--namespace=loki-stack
--set persistence.enabled=true,persistence.size=10Gi,config.auth_enabled=true
helm upgrade --install promtail grafana/promtail \
--version 3.11.0 \
--namespace loki-stack \
-f ../promtail-values.yaml
helm upgrade --install grafana grafana/grafana \
--version 6.21.2 \
--namespace loki-stack \
--set persistence.enabled=true,persistence.type=pvc,persistence.size=10Gi

.PHONY: kind-cluster-calico-create
kind-cluster-calico-create: $(KIND)
Expand Down
3 changes: 2 additions & 1 deletion _run/kube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ provider-run:
--cluster-node-port-quantity 100 \
--cluster-public-hostname "$(GATEWAY_HOSTNAME)" \
--bid-price-strategy "randomRange" \
--deployment-runtime-class "none"
--deployment-runtime-class "none" \
--hostname-operator-endpoint "localhost:8085"

.PHONY: provider-lease-status
provider-lease-status:
Expand Down
4 changes: 0 additions & 4 deletions _run/kube/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- hello.localhost
to:
- global: true
ip: "foobario"
bew:
image: quay.io/ovrclk/demo-app
expose:
Expand Down Expand Up @@ -54,6 +53,3 @@ deployment:
westcoast:
profile: web
count: 1
endpoints:
foobario:
kind: ip
7 changes: 7 additions & 0 deletions _run/promtail-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config:
lokiAddress: http://loki.loki-stack:3100/loki/api/v1/push
snippets:
pipelineStages:
- cri: {}
- tenant:
source: namespace
Loading