-
Notifications
You must be signed in to change notification settings - Fork 13
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
ROX-18942 - Add operator configuration in fleetshard-sync #1157
Conversation
Skipping CI for Draft Pull Request. |
rhacs_operator: | ||
resources: | ||
limits: | ||
cpu: 0.5 | ||
memory: "1GiB" | ||
requests: | ||
cpu: 50m | ||
memory: "250MiB" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhacs_operator: | |
resources: | |
limits: | |
cpu: 0.5 | |
memory: "1GiB" | |
requests: | |
cpu: 50m | |
memory: "250MiB" | |
rhacs_operator: | |
default: | |
resources: | |
limits: | |
cpu: 0.5 | |
memory: "1GiB" | |
requests: | |
cpu: 50m | |
memory: "250MiB" | |
quay.io/rhacs-eng/stackrox@sha256:asdfasdfsadfasdfasf: | |
resources: | |
limits: | |
cpu: 0.5 | |
memory: "1GiB" | |
requests: | |
cpu: 50m | |
memory: "250MiB" |
@@ -115,11 +115,11 @@ spec: | |||
timeoutSeconds: 1 | |||
resources: | |||
limits: | |||
cpu: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put those under operator.resources...
? Because we might want to also configure the rbac-proxy
(e.g. rbac-proxy.resources...
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point
@@ -0,0 +1,15 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be the git-ops config map as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this will be removed
name: fleetshard-sync-config | ||
data: | ||
config.yaml: | | ||
rhacs_operator: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be rather
operators:
- image: ...
operator:
resources: ...
rbacProxy: ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@ludydoo fyi The PR is out of date with the recent design changes we discussed. |
Image string `yaml:"image"` | ||
GitRef string `yaml:"gitRef"` | ||
HelmValues string `yaml:"helmValues,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using json
should work too
return []byte(` | ||
- gitRef: 4.1.1 | ||
image: "quay.io/rhacs-eng/stackrox-operator:4.0.0" | ||
helmValues: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to use a string here and not an object & unmarshaling it into a map[string]interface{}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not found a way to define an unstructured object to the OpenAPI spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kurlov, SimonBaeumer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
/retest |
@@ -28,7 +28,7 @@ type Config struct { | |||
CreateAuthProvider bool `env:"CREATE_AUTH_PROVIDER" envDefault:"false"` | |||
MetricsAddress string `env:"FLEETSHARD_METRICS_ADDRESS" envDefault:":8080"` | |||
EgressProxyImage string `env:"EGRESS_PROXY_IMAGE"` | |||
BaseCrdURL string `env:"BASE_CRD_URL" envDefault:"https://raw.githubusercontent.com/stackrox/stackrox/%s/operator/bundle/manifests/"` | |||
DefaultBaseCRDURL string `env:"DEFAULT_BASE_CRD_URL" envDefault:"https://raw.githubusercontent.com/stackrox/stackrox/%s/operator/bundle/manifests/"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider something like:
DefaultBaseCRDURL string `env:"DEFAULT_BASE_CRD_URL" envDefault:"https://raw.githubusercontent.com/stackrox/stackrox/%s/operator/bundle/manifests/"` | |
CentralCRDURLTemplate string `env:"CENTRAL_CRD_URL_TEMPLATE" envDefault:"https://raw.githubusercontent.com/stackrox/stackrox/{{ .GitRef }} /operator/bundle/manifests/platform.stackrox.io_centrals.yaml"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the variable and replaced it with a constant. We can overwrite the default via GitOps, there is no need for a config as an env variable, it would be duplicated.
var errors []error | ||
manager := ACSOperatorManager{ | ||
// TODO: align config URL with fleetshard-sync default | ||
DefaultBaseCRDURL: "https://raw.githubusercontent.com/stackrox/stackrox/%s/operator/bundle/manifests/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this duplicated there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it and replaced with a constant
Description
This PR adds a declarative structure to configure RHACS operators to deploy to a data-plane cluster.
OperatorConfigs
represents all Operators including a CRD which should be installed.The Operators are a slice of
OperatorConfig
which is applied to the Helm chart.The
Validate
function executes extended validation when the configuration is read to provide early failures and being used from a CLI context.It also validates the Helm chart rendering including CRD download.
The API call to the private Central list call, polled by fleetshard, is extended with a property for the operator configurations.
Data Structure
Example structure:
Checklist (Definition of Done)
Test manual
ROX-12345: ...
TODO
Test manual