Skip to content
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

subscribe git channel with Chart.yaml and values.yaml files #159

Open
callum-stakater opened this issue Apr 12, 2022 · 5 comments
Open

subscribe git channel with Chart.yaml and values.yaml files #159

callum-stakater opened this issue Apr 12, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@callum-stakater
Copy link

If you create a git channel and subscribe to a path that contains a Chart.yaml and values.yaml I would except OCM to be able to deploy the chart similar to how ArgoCD is able too

It seems it is able to determine the Chart.yaml is a helm object and creates a HelmRelease but seems no resources are deployed

Example:

## I was hoping this one would work, to source Chart.yaml from git repo but it doesnt
## seem to work as expected, it does create the helmrelease but cant see why the resources
## dont get deployed

apiVersion: v1
kind: Namespace
metadata:
  name: nordmart-review
---
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
  name: nordmart-review
  namespace: nordmart-review
spec:
  componentKinds:
  - group: apps.open-cluster-management.io
    kind: Subscription
  descriptor: {}
  selector:
    matchExpressions:
      - key: app
        operator: In
        values:
          - nordmart-review
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
  annotations:
    apps.open-cluster-management.io/git-branch: main
    apps.open-cluster-management.io/git-path: deploy/
    apps.open-cluster-management.io/reconcile-option: replace
  labels:
    app: nordmart-review
  name: nordmart-review-subscription-dev
  namespace: nordmart-review
spec:
  channel: rhacm-channel-stakater-lab-nordmart-review/rhacm-channel-stakater-lab-nordmart-review
  placement:
    placementRef:
      kind: PlacementRule
      name: nordmart-review-placement-dev
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
metadata:
  labels:
    app: nordmart-review
  name: nordmart-review-placement-dev
  namespace: nordmart-review
spec:
  clusterConditions:
    - type: ManagedClusterConditionAvailable
      status: "True"
 ---
 apiVersion: v1
kind: Namespace
metadata:
  name: rhacm-channel-stakater-lab-nordmart-review
---
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
  annotations:
    apps.open-cluster-management.io/reconcile-rate: medium
  name: rhacm-channel-stakater-lab-nordmart-review
  namespace: rhacm-channel-stakater-lab-nordmart-review
spec:
  type: Git
  pathname: 'https://github.com/stakater-lab/stakater-nordmart-review'

All the content here is publicly available so should be possible to deploy this as is to recreate the issue

Struggling to find any thing relevant in docs or google foo which makes me think I am maybe doing something wrong?

@callum-stakater callum-stakater added the bug Something isn't working label Apr 12, 2022
@mikeshng mikeshng self-assigned this Apr 12, 2022
@mikeshng
Copy link
Member

@callum-stakater could you please confirm this is the right folder you are targeting to install as Helm chart? https://github.com/stakater-lab/stakater-nordmart-review/tree/main/deploy

Based on my understanding of Helm https://helm.sh/docs/topics/charts/
you should have at least a templates folder containing the manifest yamls you are trying to install.

What happen if you don't use OCM appsub to install this helm chart but just use the regular helm CLI?
For example, what happen if you run helm install deploy deploy ?

@callum-stakater
Copy link
Author

callum-stakater commented Apr 13, 2022 via email

@callum-stakater
Copy link
Author

i see helm install has the flag:

--dependency-update            update dependencies if they are missing before installing the chart

is OCM basically doing a helm install under the hood?

@mikeshng
Copy link
Member

@callum-stakater Yes, the OCM app-addon is basically doing a helm install via a Helm3 SDK call. But it's currently not passing the --dependency-update flag. There is also no options to pass in additional params for these type of flags. Since the Helm related code is mostly from https://github.com/operator-framework/operator-sdk I am going to reach out to the maintainers over there first and see how to adopt this feature. Thanks for reporting.

@mikeshng
Copy link
Member

It looks like the operator-sdk helm operator "version 2" is going to have this type of support
https://github.com/operator-framework/helm-operator-plugins/blob/6470a8f4bc1311e47826584fc502a52ce58d23f0/pkg/reconciler/reconciler.go#L731-L736

For future note: if we want something similar, we can follow the same design in operator-framework/helm-operator-plugins project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants