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

Add option to generate CRD #220

Closed
albundy83 opened this issue Jan 26, 2024 · 1 comment
Closed

Add option to generate CRD #220

albundy83 opened this issue Jan 26, 2024 · 1 comment

Comments

@albundy83
Copy link

It seems that witch helm v3 for some chart, we need to pass the option --include-crds to generate CRDs like with argo-cd.
I have created this object:

apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
  name: argo-cd
  namespace: kube-system
spec:
  bootstrap: false
  chart: argo-cd
  repo: https://argoproj.github.io/argo-helm
  version: 2.9.5
  targetNamespace: argo-cd
  createNamespace: true
  valuesContent: |
    crds:
      install: true
    dex:
      enabled: false
    server:
      ingress:
        enabled: true
        annotations:
          cert-manager.io/cluster-issuer: letsencrypt-prod
          nginx.ingress.kubernetes.io/backend-protocol: HTTPS
          nginx.ingress.kubernetes.io/whitelist-source-range: x.x.x.x/32,x.x.x.x/32
        ingressClassName: nginx
        hosts:
          - my-argo-cd.fr
        tls:
          - secretName: my-argo-cd.fr
            hosts:
              - my-argo-cd.fr
        https: true
    configs:
      cm:
        url: https://my-argo-cd.fr
        admin:
          enabled: false
      rbac:
        policy.csv: |
          g, argocd-admins, role:admin
          g, argocd-viewers, role:readonly
          g, myapp-prod-viewers, role:myapp-prod-view-role
          p, role:myapp-prod-view-role, applications, *, myapp/myapp-prod, allow
          p, role:myapp-prod-view-role, applications, update, *, deny
          p, role:myapp-prod-view-role, applications, delete, *, deny 
          g, myapp-prod-admins, role:myapp-prod-admin-role
          p, role:myapp-prod-admin-role, applications, *, myapp/myapp-prod, allow"
      oidc:
        config: |
          name: keycloak
          issuer: https://idp.docapost.io/auth/realms/XXX
          clientID: client_argo-cd
          clientSecret: $oidc.keycloak.clientSecret
          requestedScopes: ["openid", "profile", "email", "groups"]
          logoutURL: https://my-keycloak/auth/realms/XXX/protocol/openid-connect/logout?id_token_hint={{ '{{token}}' }}&post_logout_redirect_uri=https%3A%2F%2Fmy-argo-cd.fr%2Fapplications"

But unfortunatelly, install Job does not work:

 helm_v3 install --namespace argo-cd --create-namespace --version 2.9.5 argo-cd argo-cd/argo-cd --values /config/values-01_HelmChart.yaml
Error: INSTALLATION FAILED: failed to install CRD crds/crd-application.yaml: resource mapping not found for name: "applications.argoproj.io" namespace: "" from "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
ensure CRDs are installed first

And in HelmChart options, I did not find a way to add --include-crds.
Is it something that could be added ?

@albundy83
Copy link
Author

Ok it seems that I have mixed argo-cd version and chart version ... :)
argo-cd is at 2.9.5 but helm chart is at 5.53.9.
Once I have fixed my version everything is working correctly.

version: 5.53.9

Sorry for this, it's friday :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants