Skip to content

k8s deployment #29

Open
Open
@jerryum

Description

@jerryum

i'm getting error after deployment - Prometheus couldn't use the end point...

  /etc/prometheus/config_out $ wget http://avalanche-svc.avalanche.svc.cluster.local:9001
  Connecting to avalanche-svc.avalanche.svc.cluster.local:9001 (10.244.0.97:9001)
  wget: server returned error: HTTP/1.1 404 Not Found

However, I found the pod logs - looks like it's generating metrics.

  jerry@Jaes-MacBook-Pro performance % kubectl logs  avalanche-6cf47d949-dxq4n -n avalanche
  Serving ur metrics at localhost:9001/metrics
  2021-12-03 01:04:45.458781499 +0000 UTC m=+30.506091744: refreshing metric values
  2021-12-03 01:05:15.455382438 +0000 UTC m=+60.502692674: refreshing metric values
  2021-12-03 01:05:15.455389516 +0000 UTC m=+60.502699712: refreshing series cycle
  2021-12-03 01:05:45.455325735 +0000 UTC m=+90.502636129: refreshing metric values
  2021-12-03 01:06:15.455331837 +0000 UTC m=+120.502642080: refreshing metric values

this is my scrap config in Promethues.

    - job_name: avalanche
      scrape_interval: 1m
      scrape_timeout: 10s
      metrics_path: /metrics
      scheme: http
      static_configs:
        - targets:
          - http://avalanche-svc.avalanche.svc.cluster.local:9001

This is my deployment file.

        #create namespace avalanche
        apiVersion: v1
        kind: Namespace
        metadata:
          name: avalanche
        spec:
          finalizers:
          - kubernetes
        #create deployment avalanche
        apiVersion: apps/v1 
        kind: Deployment
        metadata:
          name: avalanche
          namespace: avalanche
          labels:
            name: avalanche
        spec:
          selector:
            matchLabels:
              app: avalanche
          replicas: 1 # tells deployment to run 1 pods matching the template
          template:
            metadata:
              labels:
                app: avalanche
            spec:
              containers:
              - name: pg-avalanche
                image: quay.io/freshtracks.io/avalanche:latest
                args:
                - "--metric-count=1000"
                - "--series-count=50"
                - "--label-count=10"
                - "--port=9001"
                ports:
                - containerPort: 9001
        ---
        #create service avalanche-svc
        apiVersion: v1
        kind: Service
        metadata:
          name: avalanche-svc
          namespace: avalanche
          labels:
            app: avalanche
        spec:
          ports:
            # the port that this service should serve on
            - port: 9001
              targetPort: 9001
              name: http-avalanchea
          type: ClusterIP
          clusterIP: None
          # label keys and values that must match in order to receive traffic for this service
          selector:
            app: avalanche

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions