Replies: 3 comments 8 replies
-
Since k8s pods are cheap and can be specified with custom resources, maybe its easiest to say "we deploy each service as a pod" - making the notifier pod not optional. Each deployment should scale to some pod count independently.
Can this be accomplished without a design change ? I'd hesitate developing an operator while changing design and also during our app-sre integration.
Database should be provided. Do we want to support running a database per pod ? |
Beta Was this translation helpful? Give feedback.
-
Will these metrics piggy back of our metrics work over the next month?
|
Beta Was this translation helpful? Give feedback.
-
After some hacking and sketching, this is the plan: ConfigMap/Secret driven:Projecting our config into a CR means the operator would need the logic to create a config and duplicate any logic for version translations in the different versions of CRs and configs. It seems to me (and this seems to be the current preferred pattern) that referencing a ConfigMap or Secret containing a config keeps the operator's types much more tidy. For example, given the following object, the webhook could examine the indicated value, see it is invalid yaml, and reject the update to the ConfigMap. ---
apiVersion: v1
kind: ConfigMap
metadata:
name: clair-config
labels:
projectquay.io/clair/validate-config: 'true'
annotations:
projectquay.io/clair/config: config.yaml
data:
config.yaml: |
---
matcher:
connstring: 'averyrealdatabase' Webhooks for config:I'd like to implement a validating webhook for the config via a label. This should prevent a whole class of errors (like malformed yaml or missing stanzas) from affecting deployments. The webhook sees an object like: ---
apiVersion: v1
kind: ConfigMap
metadata:
name: clair-config
labels:
projectquay.io/clair/template-config: 'true'
annotations:
projectquay.io/clair/template-input: config.yaml.in
projectquay.io/clair/template-output: config.yaml
data:
config.yaml.in: |
---
matcher:
connstring: secret://database/DSN It's selected for this behavior because of the label, and has annotations indicating what members of the object to look at. ---
apiVersion: v1
kind: ConfigMap
metadata:
name: clair-config
labels:
projectquay.io/clair/template-config: 'true'
annotations:
projectquay.io/clair/template-input: config.yaml.in
projectquay.io/clair/template-output: config.yaml
data:
config.yaml.in: |
---
matcher:
connstring: secret://database/DSN
config.yaml: |
---
matcher:
connstring: 'database=clair user=user' 4 CRsI think the best way to go about things is going to be to make 4 separate CRs: The first 3 are mostly identical and will share a bunch of their logic; they'll run containers in their respective mode. They'll have a weak reference to a ConfigMap/Secret for their config, and then own HPA, Service, Deployment, and Monitoring objects. The The cluster capability detection should be able to be shared across all the CRs, and the per-service objects will probably share the bulk of their reconcile loop. This means the CRs will look roughly like: --
apiVersion: v1
kind: clair.projectquay.io/Indexer
metadata:
name: indexer
namespace: default
spec:
config:
namespace: default
name: clair-config |
Beta Was this translation helpful? Give feedback.
-
Problem
Clair's deployment is flexible and complex enough that we should provide help beyond documentation for operating Clair.
Solution
We should provide an Operator for managing Clair deployments.
This fits in well with the strategy for Quay (our biggest known integrator) and should generalize to any k8s environment.
Why not...
Helm
I do not think Helm takes a very sound approach, with the stringly typed yaml templating.
Questions
What should be supported?
I think we should only support a heterogeneous deployment, i.e. more than just Combo mode, so at least two deployments, one each for the matcher and indexer, and an optional other for the notifier.
Should we split out updater jobs into a cron job?
The updaters would then have their own cpu and memory accounting and have dashboard-level visibility.
What should be provided?
A database should probably be pulled in automatically.
Beta Was this translation helpful? Give feedback.
All reactions