Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metrics-operator): add analysis controller #1875

Merged
merged 84 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c151e1e
feat(metrics-operator): introduce new provider interface function
RealAnna Aug 24, 2023
e4db691
feat(metrics-operator): introduce new provider interface function test
RealAnna Aug 24, 2023
9e61703
feat(metrics-operator): introduce newanalysis controller
RealAnna Aug 24, 2023
177d1c8
feat(metrics-operator): added namespace to getters and introduced int…
RealAnna Aug 24, 2023
4801a2f
feat(metrics-operator): injected error in score computation
RealAnna Aug 24, 2023
cb75298
feat(metrics-operator): injected error in score computation
RealAnna Aug 24, 2023
a983314
feat(metrics-operator): addded new generate template and fixed webhoo…
RealAnna Aug 24, 2023
9b0d63b
feat(metrics-operator): rebased
RealAnna Aug 24, 2023
27f2241
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
a16e652
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
4cb09ad
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
7a91032
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
816ece6
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
9054678
feat(metrics-operator): fixed test
RealAnna Aug 24, 2023
0ca5f67
feat(metrics-operator): added status
RealAnna Aug 25, 2023
2445b9a
feat(metrics-operator): added status as json
RealAnna Aug 25, 2023
fd4935e
feat(metrics-operator): added flag
RealAnna Aug 25, 2023
7195044
feat(metrics-operator): turn on analysis in tests
RealAnna Aug 25, 2023
281cfe5
feat(metrics-operator): lint
RealAnna Aug 25, 2023
68edacf
feat(metrics-operator): lint
RealAnna Aug 25, 2023
ecd4073
feat(metrics-operator): lint helm test
RealAnna Aug 25, 2023
ac63f9e
feat(metrics-operator): lint helm test
RealAnna Aug 25, 2023
2341361
feat(metrics-operator): lint helm test
RealAnna Aug 25, 2023
6b52716
feat(metrics-operator): lint helm test
RealAnna Aug 25, 2023
d4434bc
feat(metrics-operator): go lint
RealAnna Aug 25, 2023
b8cb0c2
feat(metrics-operator): go lint
RealAnna Aug 25, 2023
c5341b2
feat(metrics-operator): go lint
RealAnna Aug 25, 2023
d278c57
feat(metrics-operator): disable linter cache
RealAnna Aug 25, 2023
2140c54
feat(metrics-operator): linted
RealAnna Aug 25, 2023
c3e705b
feat(metrics-operator): fixed integration test
RealAnna Aug 25, 2023
aaef7a9
feat(metrics-operator): added default range and provider mock
RealAnna Aug 25, 2023
7354a20
feat(metrics-operator): fix integr test
RealAnna Aug 25, 2023
7e5af0a
feat(metrics-operator): more efficient task allocation
RealAnna Aug 25, 2023
dc3c87c
feat(metrics-operator): refactored interfaces
RealAnna Aug 25, 2023
fcfdcc8
feat(metrics-operator): added evaluate test
RealAnna Aug 25, 2023
4791815
feat(metrics-operator): update last tests
RealAnna Aug 25, 2023
a6adfc9
feat(metrics-operator): lint
RealAnna Aug 25, 2023
d1ddf2f
feat(metrics-operator): lint
RealAnna Aug 25, 2023
09acc3b
feat(metrics-operator): fixed namespace
RealAnna Aug 28, 2023
00ce6e8
feat(metrics-operator): missing init
RealAnna Aug 28, 2023
1526083
feat(metrics-operator): missing init
RealAnna Aug 28, 2023
d6b0846
feat(metrics-operator): refactored to fail with context
RealAnna Aug 28, 2023
2b053b0
feat(metrics-operator): set prometheus step to 1 minute
RealAnna Aug 28, 2023
69e53fb
feat(metrics-operator): change query for integration test
RealAnna Aug 28, 2023
6146021
feat(metrics-operator): updated status and integration test
RealAnna Aug 28, 2023
30ac541
feat(metrics-operator): updated status and integration test
RealAnna Aug 28, 2023
35fad4b
feat(metrics-operator): fix integration test
RealAnna Aug 29, 2023
cbeb6fd
feat(metrics-operator): fix integration test
RealAnna Aug 29, 2023
e94fa1c
feat(metrics-operator): fix logger name
RealAnna Aug 29, 2023
a3014ea
feat(metrics-operator): added retry logic
RealAnna Aug 29, 2023
9b03a99
feat(metrics-operator): fixed tests
RealAnna Aug 29, 2023
2948baa
feat(metrics-operator): fixed tests
RealAnna Aug 29, 2023
c31054f
feat(metrics-operator): fixed tests
RealAnna Aug 29, 2023
ec96c05
feat(metrics-operator): renamed crd status
RealAnna Aug 29, 2023
bf5c465
feat(metrics-operator): renamed cache
RealAnna Aug 29, 2023
14987a7
feat(metrics-operator): fixed integration test with Flo suggested query
RealAnna Aug 30, 2023
ff030a8
feat(metrics-operator): helm fix
RealAnna Aug 30, 2023
c874087
feat(metrics-operator): fixed ctx error and integration test
RealAnna Aug 30, 2023
d7544be
feat(metrics-operator): fixed integration test
RealAnna Aug 30, 2023
07265f9
feat(metrics-operator): cleanup
RealAnna Aug 30, 2023
cbc14d0
feat(metrics-operator): lint
RealAnna Aug 30, 2023
72e5a7f
feat(metrics-operator): lint
RealAnna Aug 30, 2023
a00dcef
feat(metrics-operator): lint
RealAnna Aug 30, 2023
ebea5c6
feat(metrics-operator): lint
RealAnna Aug 30, 2023
1a71914
feat(metrics-operator): lint
RealAnna Aug 30, 2023
240769b
feat(metrics-operator): lint
RealAnna Aug 30, 2023
9d0a638
feat(metrics-operator): added test for empty tasks
RealAnna Aug 30, 2023
0837a33
feat(metrics-operator): added test for empty tasks
RealAnna Aug 30, 2023
9bebce4
feat(metrics-operator): added test for datadog
RealAnna Aug 30, 2023
1136ba8
Update metrics-operator/api/v1alpha3/analysis_types.go
RealAnna Aug 31, 2023
fc9cdfb
fix(metrics-operator): according to review
RealAnna Aug 31, 2023
88fe8f6
fix(metrics-operator): lint
RealAnna Aug 31, 2023
bc51d51
fix(metrics-operator): lint
RealAnna Aug 31, 2023
ffdb5ae
Update metrics-operator/controllers/analysis/controller.go
RealAnna Aug 31, 2023
a7ca1bf
Update metrics-operator/controllers/analysis/controller.go
RealAnna Aug 31, 2023
9a156e8
Update metrics-operator/controllers/analysis/controller.go
RealAnna Aug 31, 2023
92aa5dd
fix(metrics-operator): fix review
RealAnna Aug 31, 2023
a5c8cae
fix(metrics-operator): fix review
RealAnna Aug 31, 2023
3acafa5
additional tests; make sure we do not depend on metric providers resp…
bacherfl Sep 1, 2023
07ba902
incorporate review comments
bacherfl Sep 1, 2023
cc80f85
updated docs
bacherfl Sep 1, 2023
ed18bb8
pr feedback
bacherfl Sep 1, 2023
738e708
try to clean up test script
bacherfl Sep 1, 2023
b801802
adapt log message
bacherfl Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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