Skip to content

Grafana Alloy (Workload) Installation

This content is not available in your language yet.

Grafana Alloy (Workload) is a Metrics/Logs/Traces Gathering from Opstella-managed Application (OpenTelemetry Enabled Applications)


Grafana Alloy (Workload) will be installed on 🟦 Non-Production Workload and 🟥 Production Workload Kubernetes Cluster

  • 📥Ingress Service provided as Kubernetes Ingress Class (IngressClass)
  • 🛡️TLS Certificate for Grafana Alloy (Workload) provided as Kubernetes Secret
    • Grafana Alloy (Workload) will be exposed as HTTPS with Kubernetes Ingress.

Ensure you have defined and loaded your Global Shell Variables as described in Shell Variables.

  1. Connect to 🟢 Management Kubernetes Cluster ; i.e w/ Kubeconfig File

    Ensure you have defined and loaded your Global Shell Variables as described in Shell Variables.

    Terminal window
    source $HOME/opstella-installation/shell-values/kubernetes/management_cluster.vars.sh
    source $HOME/opstella-installation/shell-values/tools/observability.vars.sh
    Terminal window
    export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/management_cluster.yaml"
  2. Set 🟢 Management Kubernetes Cluster Information

    Ensure K8S_INTERNAL_DOMAIN, K8S_INGRESSCLASS_NAME, K8S_STORAGECLASS_NAME are defined as per the Shell Variables guide.

  3. Create Kubernetes Secret for 🛡️ TLS Certificate for Grafana Alloy (Workload) in Namespace observability-system.

    Kubernetes Ingress for Grafana Alloy (Workload) will associate TLS Certificate with Kubernetes Secret named wildcard-${BASE_DOMAIN}-tls.

    export K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME="wildcard-${BASE_DOMAIN}-tls"

    Create one using from .crt and .key file.

    Terminal window
    kubectl create secret tls $K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME \
    --cert=/path/to/cert/file --key=/path/to/key/file \
    --namespace observability-system

    💡 Should return secret/wildcard-${BASE_DOMAIN}-tls created message.

  1. Create Helm Values Configuration, create for 🟦 Non-Production Workload Kubernetes Cluster

    Terminal window
    cat <<EOF > $HOME/opstella-installation/helm-values/grafana-alloy-workload-nonprod-full-values.yaml
    ## Global properties for image pulling override the values defined under 'image.registry' and 'configReloader.image.registry'.
    ## If you want to override only one image registry, use the specific fields but if you want to override them all, use 'global.image.registry'
    global:
    # -- Security context to apply to the Grafana Alloy pod.
    podSecurityContext:
    fsGroup: 473
    # Options for the extra controller used for config reloading.
    configReloader:
    securityContext:
    runAsUser: 473
    runAsGroup: 473
    runAsNonRoot: true
    privileged: false
    allowPrivilegeEscalation: false
    capabilities:
    drop: ["ALL"]
    seccompProfile:
    type: "RuntimeDefault"
    # Options for the extra controller used for config reloading.
    alloy:
    ## OPSTELLA_CUSTOMIZE: SecuityContext
    securityContext:
    runAsUser: 473
    runAsGroup: 473
    runAsNonRoot: true
    privileged: false
    allowPrivilegeEscalation: false
    capabilities:
    drop: ["ALL"]
    seccompProfile:
    type: "RuntimeDefault"
    configMap:
    create: true
    ## OPSTELLA_CUSTOMIZE: Enable Alloy Clustering
    clustering:
    # -- Deploy Alloy in a cluster to allow for load distribution.
    enabled: true
    ## OPSTELLA_CUSTOMIZE: Enable Alloy to be OTel gRPC Receiver
    extraPorts:
    - name: otlp-grpc
    port: 4317
    targetPort: 4317
    protocol: "TCP"
    EOF
  2. Create Helm Values Configuration, create for 🟥 Production Workload Kubernetes Cluster

    Terminal window
    cat <<EOF > $HOME/opstella-installation/helm-values/grafana-alloy-workload-prod-full-values.yaml
    ## Global properties for image pulling override the values defined under 'image.registry' and 'configReloader.image.registry'.
    ## If you want to override only one image registry, use the specific fields but if you want to override them all, use 'global.image.registry'
    global:
    # -- Security context to apply to the Grafana Alloy pod.
    podSecurityContext:
    fsGroup: 473
    # Options for the extra controller used for config reloading.
    configReloader:
    securityContext:
    runAsUser: 473
    runAsGroup: 473
    runAsNonRoot: true
    privileged: false
    allowPrivilegeEscalation: false
    capabilities:
    drop: ["ALL"]
    seccompProfile:
    type: "RuntimeDefault"
    # Options for the extra controller used for config reloading.
    alloy:
    ## OPSTELLA_CUSTOMIZE: SecuityContext
    securityContext:
    runAsUser: 473
    runAsGroup: 473
    runAsNonRoot: true
    privileged: false
    allowPrivilegeEscalation: false
    capabilities:
    drop: ["ALL"]
    seccompProfile:
    type: "RuntimeDefault"
    configMap:
    create: true
    ## OPSTELLA_CUSTOMIZE: Enable Alloy Clustering
    clustering:
    # -- Deploy Alloy in a cluster to allow for load distribution.
    enabled: true
    ## OPSTELLA_CUSTOMIZE: Enable Alloy to be OTel gRPC Receiver
    extraPorts:
    - name: otlp-grpc
    port: 4317
    targetPort: 4317
    protocol: "TCP"
    EOF
  3. Create Kubernetes Manifest Configuration for Grafana Alloy Health Checking for 🟦 Non-Production Workload

    Set Domain for Grafana Alloy

    export GRAFANA_ALLOY_WORKLOAD_DOMAIN="alloy-nonprod.${BASE_DOMAIN}"
    Terminal window
    kubectl apply --namespace observability-agents -f - <<EOF
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: grafana-alloy-workload-healthcheck
    namespace: observability-agents
    annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /-/ready
    spec:
    ingressClassName: ${K8S_INGRESSCLASS_NAME}
    tls:
    - secretName: ${K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME}
    rules:
    - host: ${GRAFANA_ALLOY_WORKLOAD_DOMAIN}
    http:
    paths:
    - path: /workload/ready
    pathType: ImplementationSpecific
    backend:
    service:
    name: grafana-alloy-workload
    port:
    number: 12345
    EOF
  4. Create Kubernetes Manifest Configuration for Grafana Alloy Health Checking for 🟥 Production Workload

    Set Domain for Grafana Alloy

    export GRAFANA_ALLOY_WORKLOAD_DOMAIN="alloy-prod.${BASE_DOMAIN}"
    Terminal window
    kubectl apply --namespace observability-agents -f - <<EOF
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    name: grafana-alloy-workload-healthcheck
    namespace: observability-agents
    annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /-/ready
    spec:
    ingressClassName: ${K8S_INGRESSCLASS_NAME}
    tls:
    - secretName: ${K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME}
    rules:
    - host: ${GRAFANA_ALLOY_WORKLOAD_DOMAIN}
    http:
    paths:
    - path: /workload/ready
    pathType: ImplementationSpecific
    backend:
    service:
    name: grafana-alloy-workload
    port:
    number: 12345
    EOF
  1. Connect to 🟦 Non-Production Workload Kubernetes Cluster ; i.e w/ Kubeconfig File

    Terminal window
    export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/nonprod_cluster.yaml"
  2. Install Grafana Alloy (Workload) on 🟦 Non-Production Workload

    • Install a Helm Release with specific Helm Chart Version --version 0.12.3 (App Version: v1.7.2)

      Terminal window
      helm install grafana-alloy-workload grafana/alloy --version 0.12.3 \
      --namespace observability-agents \
      -f $HOME/opstella-installation/helm-values/grafana-alloy-workload-nonprod-full-values.yaml
  3. Apply Kubernetes Manifest on 🟦 Non-Production Workload

    Terminal window
    kubectl apply -f $HOME/opstella-installation/kubernetes-manifests/grafana-alloy-nonprod-healthcheck-ingress.yaml
  4. Connect to 🟥 Production Workload Kubernetes Cluster ; i.e w/ Kubeconfig File

    Terminal window
    export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/prod_cluster.yaml"
  5. Install Grafana Alloy (Workload) on 🟥 Production Workload

    Terminal window
    helm install grafana-alloy-workload grafana/alloy --version 0.12.3 \
    --namespace observability-agents \
    -f $HOME/opstella-installation/helm-values/grafana-alloy-workload-prod-full-values.yaml
  6. Apply Kubernetes Manifest on 🟥 Production Workload

    Terminal window
    kubectl apply -f $HOME/opstella-installation/kubernetes-manifests/grafana-alloy-prod-healthcheck-ingress.yaml
  1. Get Pods Status

    Terminal window
    kubectl get pods -n observability-agents

    Grafana Alloy should be Running

    NAME READY STATUS RESTARTS AGE
    ... (deducted)
    grafana-alloy-workload-0 1/1 Running 0 Xd
    grafana-alloy-workload-1 1/1 Running 0 Xd
    grafana-alloy-workload-2 1/1 Running 0 Xd

Finished?

Use the below navigation to proceed