Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

[Question] Can an ApplicationConfiguration deploy Components to different namespaces? #234

Open
mgianatagh opened this issue Oct 8, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@mgianatagh
Copy link

My use case is that I would like to create a single ApplicationConfiguration that would deploy Components into designated namespaces. As opposed to creating an ApplicationConfiguration for each namespace. Is this a use case that is or will be supported?

I tried to accomplish this using a parameter to set the metadata.namespace value for the component.

My test component file was as follows. I created it in the default namespace.

apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: robert-helidon
spec:
  workload:
    apiVersion: core.oam.dev/v1alpha2
    kind: ContainerizedWorkload
    metadata:
      name: robert-helidon
      labels:
        app: robert-helidon
    spec:
      containers:
        - name: robert-helidon-stock-application
          image: "foo"
  parameters:
    - name: instance-namespace
      fieldPaths:
        - metadata.namespace

My test ApplicationConfiguration file was as follows. I created it in the default namespace and pre-created the namespace robert.

apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
  name: robert
  annotations:
    version: v1.0.0
    description: "Robert"
spec:
  components:
    - componentName: robert-helidon
      parameterValues:
        - name: instance-namespace
          value: robert

The result was that application was deployed to the default namespace instead of robert

@mgianatagh mgianatagh added the help wanted Extra attention is needed label Oct 8, 2020
@resouer
Copy link
Contributor

resouer commented Oct 8, 2020

Hi @mgianatagh , cross-namespace operation is complex and unpredictable in Kubernetes and I am afraid it will create heavy burden on the trait implementation side.

Not sure if you envision this as a feature for OAM runtime? Or you just hope to save time to copy-paste AppConfig in multiple namespaces? The latter scenario could be partially fixed by yaml tools like kustomize etc.

@mgianatagh
Copy link
Author

Thank you for your response.

I was envisioning this as a feature. For the scenario I was using as a test case, the complete application needs to be deployed to three separate namespaces. For me it would have been preferable to see the entire layout of the application in a single ApplicationConfiguration file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants