https://pulumi.com logo
#general
Title
# general
l

limited-army-96747

12/13/2021, 5:39 PM
And this is what I want to achieve:
Copy code
apiVersion: <http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>
kind: Application
metadata:
  name: alb-controller
  namespace: argocd
  finalizers:
    - <http://resources-finalizer.argocd.argoproj.io|resources-finalizer.argocd.argoproj.io>
spec:
  project: default
  # Source of the application manifests
  source:
    repoURL: <https://bitbucket.org/mycharts/infra.git>
    targetRevision: main
    path: k8s/charts/alb-controller
    # helm specific config
    helm:
      values: |
        image: 
          repository: <http://123456789.dkr.ecr.eu-west-1.amazonaws.com/backend|123456789.dkr.ecr.eu-west-1.amazonaws.com/backend>
          pullPolicy: IfNotPresent
          tag: latest
b

billowy-army-68599

12/13/2021, 5:42 PM
@limited-army-96747 are you struggling with the helm values part?
l

limited-army-96747

12/13/2021, 5:42 PM
@billowy-army-68599 that is correct
b

billowy-army-68599

12/13/2021, 5:45 PM
I would use
json.stringify
here:
Copy code
let helm_values = JSON.stringify({
  image: {
    repository: "<http://123456789.dkr.ecr.eu-west-1.amazonaws.com/backend|123456789.dkr.ecr.eu-west-1.amazonaws.com/backend>"
  }
})

const albController = new k8s.apiextensions.CustomResource('alb-controller', {
  apiVersion: '<http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>',
  kind: 'Application',
  metadata: {
    name: 'alb-controller',
    namespace: 'argocd',
    finalizers: ['<http://resources-finalizer.argocd.argoproj.io|resources-finalizer.argocd.argoproj.io>'],
  },
  spec: {
    project: 'default',
    source: {
      repoURL: '<https://bitbucket.org/mycharts/infra.git>',
      targetRevision: 'main',
      path: 'k8s/charts/alb-controller',
      helm: helm_values
      },
    },
  },
}, { dependsOn: [argocd] })
l

limited-army-96747

12/14/2021, 9:38 AM
that did not work 😞 But I have found a different way to pass the values to argo Thanks anyway
b

billowy-army-68599

12/14/2021, 3:47 PM
@limited-army-96747 mind sharing your solution?
l

limited-army-96747

12/14/2021, 10:37 PM
@billowy-army-68599
Copy code
helm: {
        parameters: [
          {
            name: 'clusterName',
            value: `eks-${pulumi.getStack()}`,
          },
          {
            name: 'vpcId',
            value: vpc.id,
          },
          {
            name: 'region',
            value: 'eu-central-1',
          },
          {
            name: 'serviceAccount.create',
            value: 'true',
          },
          {
            name: 'roleArn"',
            value: albPodRole.arn,
          },
          {
            name: 'computeType',
            value: 'fargate',
          },
          {
            name: 'fargateProfile',
            value: fargateProfile.arn,
          },
        ],
      },
that is not ideal, because I can't pass eks annotations that uses
.
I was unable to find a way to escape it. So I had to tweak the chart a little
but it is working