replicatedhq / troubleshoot

Preflight Checks and Support Bundles Framework for Kubernetes Applications
https://troubleshoot.sh
Apache License 2.0
543 stars 93 forks source link

feat: [sc-106625] http analyzer for in-cluster #1566

Closed nvanthao closed 3 months ago

nvanthao commented 3 months ago

Story details: https://app.shortcut.com/replicated/story/106625

Changes

Sample spec

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - http:
        collectorName: healthz
        get:
          url: https://dummyjson.com/test
          timeout: 5s
  analyzers:
    - http:
        collectorName: healthz
        outcomes:
          - warn:
              when: "error"
              message: Error connecting to dummyjson.com/test
          - pass:
              when: "statusCode == 200"
              message: Connected to dummyjson.com/test
          - warn:
              message: "Unexpected response"
apiVersion: troubleshoot.sh/v1beta2
kind: Preflight
metadata:
  name: sample
spec:
  collectors:
    - http:
        collectorName: healthz
        get:
          url: https://dummyjson.com/test
          timeout: 5s
  analyzers:
    - http:
        collectorName: healthz
        outcomes:
          - warn:
              when: "error"
              message: Error connecting to dummyjson.com/test
          - pass:
              when: "statusCode == 200"
              message: Connected to dummyjson.com/test
          - warn:
              message: "Unexpected response"
nvanthao commented 3 months ago

Many thanks @DexterYan !