apiVersion: metrics.keptn.sh/v1
kind: AnalysisValueTemplate
metadata:
  name: ready
spec:
  provider:
    name: my-mocked-provider
  query: 'sum(kube_pod_container_status_ready{namespace="{{.ns}}"})'
---
apiVersion: metrics.keptn.sh/v1
kind: AnalysisDefinition
metadata:
  name: ed-my-proj-dev-svc1
spec:
  objectives:
    - analysisValueTemplateRef:
        name: ready
      target:
        failure:
          lessThan:
            fixedValue: 2
        warning:
          lessThan:
            fixedValue: 3
      weight: 1
      keyObjective: false
  totalScore:
    passPercentage: 90
    warningPercentage: 75
---
apiVersion: metrics.keptn.sh/v1
kind: Analysis
metadata:
  name: analysis-sample
spec:
  timeframe:
    from: 2023-09-14T07:33:19Z
    to: 2023-09-14T08:33:19Z
  args:
    "ns": "keptn-system"
  analysisDefinition:
    name: ed-my-proj-dev-svc1
status:
  storedValues:
    my-provider-query-1:
      objectiveReference:
        name: objective-template-1
      value: 1
      errMsg: ""

---
apiVersion: metrics.keptn.sh/v1
kind: KeptnMetricsProvider
metadata:
  name: my-mocked-provider
spec:
  type: prometheus
  targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080']))
