-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement Airgapped Configuration Mechanism #15518
Comments
We discussed using init containers for transforming configuration values into files on in user.home. How exactly this would work needs to be designed. |
@slemeur not really...it's a prerequisite, but we still need mechanisms for creating those files. Environment variables cannot be used in settings.xml |
The idea is to collect the various ways we can configure language support for airgapped for different tools. Once we have that, we can design a proper config mechanism. |
@tsmaeder what about using an init container as described in #14857 (comment). It would be one distinct init container for every dependency manager we support but the mechanism would be the same (env var + init container). |
One mechanism that seems to tick all the boxes I've come up with:
|
@l0rd @slemeur @skabashnyuk wdyt? |
can we also have either:
or
|
We can add the same configuration mechanism to the meta.yml in the plugin. Also, we could make the creation of each file depend on the presence of a particular env variable. |
We might not cover all cases and combinations, but at least we have 90% covered. |
would part of this be covered with enabling kubernetes secrets ? |
Well, the plan includes a provision for evaluating env vars in the file content, so I guess you can use stuff from there. |
FYI downstream request for this feature in https://issues.redhat.com/browse/CRW-610 Something we can do in 7.9? |
To be done here:
|
@nickboldt can you tell how the mechanism to override stuff in crw ("resource.yaml") functions or do you know who to ask? |
I've started a write up of the problem in a google doc: https://docs.google.com/document/d/1rE7MFUPnP3pq57vGM_DqyuFvlCbjYuqe-xFXgDiXSEM/edit#heading=h.3lz6pxl55uha |
Would be better in a document that anybody could be able to open.
…On Wed, Feb 12, 2020 at 4:27 PM Thomas Mäder ***@***.***> wrote:
I've started a write up of the problem in a google doc:
https://docs.google.com/document/d/1rE7MFUPnP3pq57vGM_DqyuFvlCbjYuqe-xFXgDiXSEM/edit#heading=h.3lz6pxl55uha
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15518>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTIOX2ZHG3LYSYANTBQTRCQIO5ANCNFSM4J4HDXEQ>
.
--
Stévan LeMeur // Product Manager // Developer Tools // +336-87-11-27-55
|
I'll make it public when it's ready for general review. |
I couldn't access to the doc,
The way I see it, is a section in the Dashboard where you could define these configmaps or secrets. We could also have configmaps or secret per organisation. and we could have a way to set these configmap or secrets through chectl. I definitely do not see these values/files defined in the devfile. But references to secrets and configmap. We could have default entries for configmaps and secrets that we use in our default devfiles. These ones could be overriden by the user. |
Here's my proposal for implementing the air-gapped configuration mechanism: it consists of a general way of generating preferences, env vars and config files based on configuration values: |
The question is when this can happen: since configuration can change, we would at least have to create/delete the secrets when we create a workspace. But better still to pick up change at each workspace start. Do you think that "lifecycle" is possible with secrets? |
let's say that a user have the previous devfile and has even created and started a workspace out of it. If he figures out it is not working (cannot access to maven central for instance), he could
And let's say he is starting another workspace from another devfile that is using maven, it would work, taking the right settings.xml |
@tsmaeder I would like Che to not be responsible for creating and updating those secrets. To allow git with SSH flow we currently persist users SSH key pairs in postgres, expose a Che API to manage them and mount them in workspace Pods in the form of Kubernetes secrets. That's something I would like us to stop doing. Instead, when provisioning a new Che user, an administrator should setup the user namespace, including the configmaps and secrets. When needed, the admin should update namespace secrets and configmaps (and any namespace object). Developers can update configmaps and secrets as well but they should not need to deal with infrastructure configs if they do not want to. cc @skabashnyuk @sunix what I am suggesting is a kind of dependency injection. It will simplify the devfile and keep it separate from infrastructure configurations. But you are right, this mechanism requires the agreement on some conventions (i.e. predictable |
@l0rd Yes, what I am suggesting is a dependency injection by name: in this container, inject How would you see the usage of secret's annotations and labels ? |
@l0rd If I understand your suggestion correctly, I see some drawbacks to your suggestion:
|
@nickboldt since air-gapped requirements are largely driven by CRW customers, I'd be interested in your input. |
@sunix I think we are converging :-) We can use (optional) devfile annotations to specify injection properties like the path. Something like: devfile.yaml
---
...
components:
- type: dockerimage
annotations:
mavenSettingsPath: /my/m2/folder/ # <--- optional, overrides secret's defaultPath
alias: maven
image: maven:3.11
... maven-settings-secret.yaml
---
apiVersion: v1
kind: Secret
metadata:
name: mvn-settings-secret
labels:
app: che # <--- mandatory: all secrets labeled `app: che` will be mounted
targetContainer: maven # <--- optional, if omitted will be mounted on all containers
annotations:
mavenSettingsPath: /home/user/.m2/
data:
settings.xml: ... @tsmaeder for 1) and 2) provision/updating users configs is about applying a template. An admin will have a template for che namespaces and will apply that every time a new Che user needs to be provisioned. That's how it works on che.openshift.io for instance. For 3) and 4) the sample above should clarify how a container and a path would be specified. |
@l0rd what is "maven-settings-secret.yml"? And I don't understand how the above addresses my point 4) from above: ~/.m2 will be broken for use with maven if you mount the secrets there. |
@l0rd I'm not objecting to having per user settings, as I stated in my original proposal, I just did not consider it something that was a stated requirement. |
Che is responsible for translating a devfile into a set of Kubernetes configurations (a pod, basically). That translation will use some central configuration values. There is no need for an API to manage anything, as far as I can see. |
@l0rd ok as long as it works. It also has to work with env variables. Some secrets are mounted as files, others would be be exposed as env variables. |
@l0rd about #15518 (comment) . What are the rules to match : annotations:
mvnSettingsSecretPath and annotations:
defaultPath: /home/user/.m2/ |
@l0rd @sunix @skabashnyuk I fear if my concerns from #15518 (comment) are not considered, we're building something that will be quite useless. |
@tsmaeder let me try to answer but I am not sure that I got your questions so let's do a call if those answers don't help.
It's the specification of a secret that contains maven settings. Secret can be mounted as files in containers as specified here. This secret should be created in the developer namespace. For example I should have the secret created on my
True. Some possible workaround: mounting |
@skabashnyuk you are right. I think that the name of the annotation should match. |
@skabashnyuk I have update the name of the annotation in the secret and the devfile to be identical ( |
@sunix I haven't tested but if |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
This is about designing and implementing one or more mechanisms for configuring build systems int he "air-gapped" case. We need to solve two distinct problems:
There are various desirable properties for any solution:
The text was updated successfully, but these errors were encountered: