turbonomic / orm Goto Github PK
View Code? Open in Web Editor NEWOperator Resource Mapping
License: Apache License 2.0
Operator Resource Mapping
License: Apache License 2.0
In first release, we only support {{owned.name}} to retrieve metadata.name of owned resource to be used in patterns. But in some cases, the information we need lives in a label (or somewhere else) rather than the name. So we want to allow orm composer to be able to provide a path to retrieve the string value anywhere inside the owned resource.
example:
- ownerPath: .spec.settings.deployment.serverBundles[?(@.name=="{{.owned.metadata.labels.xxx/yyy}}")].replica
owned:
apiVersion: apps/v1
kind: Deployment
selector: serverBundle_component
path: .spec.replicas
If the path does not point to a string value, an error should be reported.
Use case 1 - labels:
metadata:
labels:
"ibm.com/type": "app"
Use case 2 - special field:
spec:
components:
ibm.com:
websphere:
resources:
In order to work with fields with dot in the key, we can't use jsonpath like .metadata.labels.ibm.com/type
or .spec.ibm.com.websphere.resources
According to evaluator from https://jsonpath.com/
the right way is to use .metadata.labels.['ibm.com/type']
.spec.['ibm.com'].websphere.resources
we need to support that approach.
The current crd is missing https://raw.githubusercontent.com/turbonomic/orm/master/config/crd/bases/turbo_operator_resource_mapping_crd.yaml
schema:
openAPIV3Schema:
is failing to deploy
The following expressions are not being matched in the Turbo ORM v2. This causes resize actions to fail in Turbo. Please add them to matchExpressions.
mediation-azureinfra
mediation-azurepricing
mediation-powervm
mediation-gcpinfra
ui
Add to following section:
spec:
mappings:
selectors:
turbo_core_components:
matchExpressions:
ORM controller detects invalid path in owner and owned resources. However, it is hard to tell whether a path is invalid or omitted (use default value) in an resource. The proposed solution is to divide the scenario into 2 cases
The solution is:
1. We introduce annotations to control the validation.
2. If validation is enabled, we only process ORM mappings with all resources are present and all paths are located.
3. If validation is disabled,
In addition to that, ORM record event for actions to OwnerCRs, and call out when omitted path are completed by ORM.
The following components are missing from the sample Turbo ORM located here: https://github.com/turbonomic/orm/blob/master/config/samples/turbo_operator_resource_mapping_sample_cr.yaml
Please add so that end users don't see failed resize actions on these containers.
@evat-pm
The duplicated long list of label selector to address different path with same group of owned resource looks clumsy. I think we can allow predefined selector (like parameters) to be reused. something like this:
...
spec:
...
mappings:
selectors:
core:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- action-orchestrator
- api
- auth
- clustermgr
...
patterns:
- ownerPath: .spec.{{.owned.name}}.resources
owned:
path: .spec.template.spec.containers[?(@.name=="{{.owned.name}}")].resources
apiVersion: apps/v1
kind: Deployment
selector: core
- ownerPath: .spec.{{.owned.name}}.replicaCount
owned:
path: .spec.replicas
apiVersion: apps/v1
kind: Deployment
selector: core
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.