oracle-cne / ocne

The Oracle Cloud Native Environment CLI
Universal Permissive License v1.0
1 stars 0 forks source link

ocne application install '-n' flag does not work as expected #66

Open kerlyn-bsd3 opened 2 weeks ago

kerlyn-bsd3 commented 2 weeks ago

According to the documentation:

$ ocne application install -h
...
  -n, --namespace string    The Kubernetes namespace that the application is installed into. The namespace is created if it does not already exist. If this value is not provided, the namespace from the current context of the kubeconfig is used.
...

What I did: $ ocne app install -c "Oracle Utilities Live Energy Connect Catalog" -N producer -n lec -u http://localhost:8080/values/

What I expected: I expected both the OCNE application and K8s pod to be running in the same (in this case, "lec") namespace.

$ kubectl get pods -A
NAMESPACE      NAME                                           READY   STATUS             RESTARTS   AGE
lec            producer-8f5c767c-rdgx8                        1/1     Running            0          80m
kube-flannel   kube-flannel-ds-6vf4v                          1/1     Running            0          2d3h
...

What I got:

$ kubectl get pods -A
NAMESPACE      NAME                                           READY   STATUS             RESTARTS   AGE
default        producer-8f5c767c-rdgx8                        1/1     Running            0          80m    <<< pod running in 'default' ns
kube-flannel   kube-flannel-ds-6vf4v                          1/1     Running            0          2d3h
...

$ ocne app list -A
Releases
NAME            NAMESPACE       CHART           STATUS          REVISION        APPVERSION
flannel         kube-flannel    flannel         deployed        1               0.22.3
kafka           lec             kafka           deployed        1               3.8.0
ocne-catalog    ocne-system     ocne-catalog    deployed        1               2.0.0
producer        lec             producer        deployed        1               0.1.0   <<< app running in 'lec' ns
ui              ocne-system     ui              deployed        1               2.0.0

Note: metadata.namespace: lec must be added to the chart's Deployment resource to correct this.

zabdulre commented 5 days ago

I was able to reproduce this scenario by editing a chart in the app catalog and removing the

namespace: {{ .Release.Namespace }}

field from the deployment template in the chart. The deployment was installed in the default namespace whereas the chart was installed in the custom-namespace I specified during the install.

George-Aeillo commented 5 days ago

I was also able to reproduce this issue. I also confirmed that the generated Helm Manifests for the Helm CLI and the OCNE CLI seem to be the same.