Skip to content

Instantly share code, notes, and snippets.

@max-cx
Last active August 3, 2023 13:48
Show Gist options
  • Save max-cx/cb4898c97e733c021d2701f88dea19f9 to your computer and use it in GitHub Desktop.
Save max-cx/cb4898c97e733c021d2701f88dea19f9 to your computer and use it in GitHub Desktop.
Installing Tempo by using the CLI

Installing Tempo by using the CLI

Prerequisites
  • An active OpenShift CLI (oc) session by a cluster administrator user. See Getting started with the OpenShift CLI.

    Tip
    Ensure that your OpenShift CLI (oc) version is up to date and matches your {product-title} version.
    1. Install the Tempo Operator:

      1. Create a subscription.

        $ oc apply -f - << EOF
        apiVersion: operators.coreos.com/v1alpha1
        kind: Subscription
        metadata:
          name: tempo-product
          namespace: openshift-operators
        spec:
          channel: stable
          installPlanApproval: Automatic
          name: tempo-product
          source: redhat-operators
          sourceNamespace: openshift-marketplace
        EOF
      2. Check the Operator status.

        oc get csv -n openshift-operators
    2. Run oc apply -f to create a Secret for your object storage bucket.

      Tip
      $ oc apply -f <secret_file>.yaml
      $ oc apply -f - << EOF
      <object_storage_secret>
      EOF
      Example 1. Secret for Amazon S3 and MinIO storage
      apiVersion: v1
      kind: Secret
      metadata:
        name: minio-test
      stringData:
        endpoint: http://minio.minio.svc:9000
        bucket: tempo
        access_key_id: tempo
        access_key_secret: supersecret
      type: Opaque
      Table 1. Required Secret parameters
      Storage provider Secret parameters

      Red Hat OpenShift Data Foundation

      name: tempostack-dev-odf # example

      bucket: <bucket_name> # requires an ObjectBucketClaim

      endpoint: https://s3.openshift-storage.svc

      access_key_id: <data_foundation_access_key_id>

      access_key_secret: <data_foundation_access_key_secret>

      MinIO

      See MinIO Operator.

      name: tempostack-dev-minio # example

      bucket: <minio_bucket_name> # MinIO documentation

      endpoint: <minio_bucket_endpoint>

      access_key_id: <minio_access_key_id>

      access_key_secret: <minio_access_key_secret>

      Amazon S3

      name: tempostack-dev-s3 # example

      bucket: <s3_bucket_name> # Amazon S3 documentation

      endpoint: <s3_bucket_endpoint>

      access_key_id: <s3_access_key_id>

      access_key_secret: <s3_access_key_secret>

      Microsoft Azure Blob Storage

      name: tempostack-dev-azure # example

      container: <azure_blob_storage_container_name> # Microsoft Azure documentation

      account_name: <azure_blob_storage_account_name>

      account_key: <azure_blob_storage_account_key>

      Google Cloud Storage on Google Cloud Platform (GCP)

      name: tempostack-dev-gcs # example

      bucketname: <google_cloud_storage_bucket_name> # requires a bucket created in a GCP project

      key.json: <path/to/key.json> # requires a service account in the bucket’s GCP project for GCP authentication

    3. Use oc create namespace or oc apply to create a namespace for the TempoStack instance that you will create in the next step.

      Tip
      oc create namespace <namespace_value_of_your_choice>
      $ oc apply -f - << EOF
      apiVersion: project.openshift.io/v1
      kind: Project
      metadata:
        labels:
          kubernetes.io/metadata.name: <namespace_value_of_your_choice>
          openshift.io/cluster-monitoring: "true"
        name: <namespace_value_of_your_choice>
      EOF
    4. Create a TempoStack instance in the namespace that you created for the TempoStack instance in the previous step.

      Note
      You can create multiple TempoStack instances in separate namespaces on the same cluster.
      1. Customize the TempoStack custom resource (CR):

        apiVersion: tempo.grafana.com/v1alpha1
        kind: TempoStack
        metadata:
          name: sample
          namespace: <namespace_from_previous_step>
        spec:
          storageSize: 1Gi
          storage:
              secret:
                  name: <secret-name> (1)
                  type: <secret-provider> (2)
          template:
            queryFrontend:
              jaegerQuery:
                enabled: true
                ingress:
                  route:
                    termination: edge
                  type: route
        1. The value of name in the metadata of the Secret.

        2. The accepted values are azure for Azure Blob Storage, gcs for Google Cloud Storage, and s3 for Amazon S3 or MinIO or Red Hat OpenShift Data Foundation.

          Example 2. TempoStack CR for AWS S3 and MinIO storage
          apiVersion: tempo.grafana.com/v1alpha1
          kind: TempoStack
          metadata:
            name: simplest
            namespace: tempostacknamespace
          spec:
            storage:
              secret:
                name: minio-test
                type: s3
            storageSize: 1Gi
            resources:
              total:
                limits:
                  memory: 2Gi
                  cpu: 2000m
            template:
              queryFrontend:
                jaegerQuery:
                  enabled: true
                  ingress:
                    route:
                      termination: edge
                    type: route

          The stack deployed in this example is configured to receive Jaeger Thrift over HTTP and OpenTelemetry Protocol (OTLP), which permits visualizing the data with the Jaeger UI.

      2. Apply the customized CR.

        $ oc apply -f - << EOF
        <TempoStack_custom_resource>
        EOF
WIP
  1. command(s) to confirm successful installation of the Operator

  2. command(s) to confirm successful deployment of a TempoStack instance

  3. if applicable, a command to open any UI console

  4. any other commands?

WIP:
  1. Verify that pods are created on the namespace.

  2. Wait until the stack stabilizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment