Skip to content

Commit

Permalink
feat(metrics-operator): add analysis controller (#1875)
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <anna.reale@dynatrace.com>
Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com>
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
  • Loading branch information
3 people committed Sep 1, 2023
1 parent 25bf6ce commit 017e08b
Show file tree
Hide file tree
Showing 65 changed files with 2,751 additions and 1,306 deletions.
1 change: 1 addition & 0 deletions .github/actions/deploy-klt-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ runs:
--set lifecycleOperator.manager.image.tag=${{ inputs.runtime_tag }} \
--set lifecycleOperator.manager.image.repository="localhost:5000/keptn/lifecycle-operator" \
--set metricsOperator.manager.imagePullPolicy=Never \
--set metricsOperator.manager.env.enableKeptnAnalysis="true" \
--set metricsOperator.manager.image.tag=${{ inputs.runtime_tag }} \
--set metricsOperator.manager.image.repository="localhost:5000/keptn/metrics-operator" \
--set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/deno-runtime:${{ inputs.runtime_tag }} \
Expand Down
344 changes: 219 additions & 125 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,79 +158,127 @@ spec:
singular: analysis
scope: Namespaced
versions:
- name: v1alpha3
schema:
openAPIV3Schema:
description: Analysis is the Schema for the analyses API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
- additionalPrinterColumns:
- jsonPath: .spec.analysisDefinition.name
name: AnalysisDefinition
type: string
- jsonPath: .status.warning
name: Warning
type: string
- jsonPath: .status.pass
name: Pass
type: string
name: v1alpha3
schema:
openAPIV3Schema:
description: Analysis is the Schema for the analyses API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: AnalysisSpec defines the desired state of Analysis
properties:
analysisDefinition:
description: AnalysisDefinition refers to the AnalysisDefinition, a
CRD that stores the AnalysisValuesTemplates
properties:
name:
description: Name of the AnalysisDefinition
type: string
metadata:
type: object
spec:
description: AnalysisSpec defines the desired state of Analysis
properties:
analysisDefinition:
description: AnalysisDefinition refers to the AnalysisDefinition,
a CRD that stores the AnalysisValuesTemplates
properties:
name:
description: Name defines the name of the referenced object
type: string
namespace:
description: Namespace defines the namespace of the referenced
object
type: string
required:
- name
type: object
args:
additionalProperties:
type: string
required:
- name
type: object
args:
additionalProperties:
description: Args corresponds to a map of key/value pairs that can
be used to substitute placeholders in the AnalysisValueTemplate
query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:)".
type: object
timeframe:
description: Timeframe specifies the range for the corresponding query
in the AnalysisValueTemplate
properties:
from:
description: From is the time of start for the query, this field
follows RFC3339 time format
format: date-time
type: string
to:
description: To is the time of end for the query, this field follows
RFC3339 time format
format: date-time
type: string
required:
- from
- to
type: object
required:
- analysisDefinition
- timeframe
type: object
status:
description: AnalysisStatus stores the status of the overall analysis
returns also pass or warnings
properties:
pass:
description: Pass returns whether the SLO is satisfied
type: boolean
raw:
description: Raw contains the raw result of the SLO computation
type: string
description: Args corresponds to a map of key/value pairs that can be
used to substitute placeholders in the AnalysisValueTemplate query.
The placeholder must be the capitalized version of the key; i.e. for
args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:)".
type: object
timeframe:
description: Timeframe specifies the range for the corresponding query
in the AnalysisValueTemplate
properties:
from:
description: From is the time of start for the query, this field
follows RFC3339 time format
format: date-time
type: string
to:
description: To is the time of end for the query, this field follows
RFC3339 time format
format: date-time
type: string
required:
- from
- to
type: object
required:
- analysisDefinition
- timeframe
type: object
status:
type: string
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
storedValues:
additionalProperties:
description: ProviderResult stores reference of already collected
provider query associated to its objective template
properties:
errMsg:
description: ErrMsg stores any possible error at retrieval time
type: string
objectiveReference:
description: Objective store reference to corresponding objective
template
properties:
name:
description: Name defines the name of the referenced object
type: string
namespace:
description: Namespace defines the namespace of the referenced
object
type: string
required:
- name
type: object
value:
description: Value is the value the provider returned
type: string
type: object
description: StoredValues contains all analysis values that have already
been retrieved successfully
type: object
warning:
description: Warning returns whether the analysis returned a warning
type: boolean
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
# Source: klt/templates/analysisdefinition-crd.yaml
apiVersion: apiextensions.k8s.io/v1
Expand Down Expand Up @@ -6964,58 +7012,100 @@ metadata:
app.kubernetes.io/version: "v0.8.1"
app.kubernetes.io/managed-by: Helm
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics/finalizers
verbs:
- update
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics/status
verbs:
- get
- patch
- update
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetricsproviders
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- providers
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- apiGroups:
- metrics.keptn.sh
resources:
- analyses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- analyses/finalizers
verbs:
- update
- apiGroups:
- metrics.keptn.sh
resources:
- analyses/status
verbs:
- get
- patch
- update
- apiGroups:
- metrics.keptn.sh
resources:
- analysisdefinitions
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- analysisvaluetemplates
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics/finalizers
verbs:
- update
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetrics/status
verbs:
- get
- patch
- update
- apiGroups:
- metrics.keptn.sh
resources:
- keptnmetricsproviders
verbs:
- get
- list
- watch
- apiGroups:
- metrics.keptn.sh
resources:
- providers
verbs:
- get
- list
- watch
---
# Source: klt/templates/metrics-operator-server-resources-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -7184,9 +7274,9 @@ roleRef:
kind: ClusterRole
name: 'metrics-operator-role'
subjects:
- kind: ServiceAccount
name: 'metrics-operator'
namespace: 'helmtests'
- kind: ServiceAccount
name: 'metrics-operator'
namespace: 'helmtests'
---
# Source: klt/templates/system-auth-delegator-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -7528,9 +7618,9 @@ roleRef:
kind: Role
name: 'metrics-operator-role'
subjects:
- kind: ServiceAccount
name: 'metrics-operator'
namespace: 'helmtests'
- kind: ServiceAccount
name: 'metrics-operator'
namespace: 'helmtests'
---
# Source: klt/templates/lifecycle-operator-metrics-service.yaml
apiVersion: v1
Expand Down Expand Up @@ -7901,8 +7991,12 @@ spec:
fieldPath: metadata.name
- name: EXPOSE_KEPTN_METRICS
value: "true"
- name: ENABLE_ANALYSIS
value: "false"
- name: METRICS_CONTROLLER_LOG_LEVEL
value: "0"
- name: ANALYSIS_CONTROLLER_LOG_LEVEL
value: "0"
- name: KUBERNETES_CLUSTER_DOMAIN
value: cluster.local
image: ghcr.io/keptn/metrics-operator:v0.8.1
Expand Down
Loading

0 comments on commit 017e08b

Please sign in to comment.