Adding or passing custom value to Helm chart addon on EKS cluster Via Cloud Formation

0

Team I Building a cloudformation stack in which we are creating AWS-EKS cluster and post creation of EKS cluster by using "Custom::Helm" resource type we are deploying Fluentbit in the cluster.

AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  pEKSClusterName:
    Description: Name of the EKS Cluster
    Type: String
    Default: EKSCluster
  VPCID:
    Description: VPC ID
    Type: AWS::EC2::VPC::Id
    AllowedPattern: ".+"   
Resources: 
  fluentbitagent:
    Type: "AWSQS::Kubernetes::Helm"
    Properties:
      TimeOut: 10
      ClusterID: !Ref pEKSClusterName
      Name: fluent-bit
      Namespace: aws-cloudwatch
      Repository: https://aws.github.io/eks-charts
      Chart: eks/aws-for-fluent-bit
      Values:
        image.repository: !FindInMap [RegionMap, !Ref "AWS::Region", cwrepo]
      ValueYaml:
        !Sub
        - |
          clusterName: ${ClusterName}
          serviceAccount:
            create: false
            name: aws-logs
          region: ${AWS::Region}
          vpcId: ${VPCID}
        - ClusterName: !Ref pEKSClusterName
          VPCID: !Ref VPCID          
Mappings:
  RegionMap:
    us-east-1:
      cwrepo: public.ecr.aws/aws-observability/aws-for-fluent-bit

I wanted to pass custom value to helm values for Fluentbit, for example i wanted to pass FluentBitHttpPort='2020', TIA:-)

2 Answers
0

You can pass custom values to the Helm chart by adding them to the "Values" property in the "fluentbitagent" resource. For example, you can add the following line under the "Values" property:

Values: ... FluentBitHttpPort: 2020

This will pass the value "2020" for the "FluentBitHttpPort" parameter in the Helm chart. Make sure the parameter is defined in the chart's values.yaml file, otherwise it will not take effect.

profile picture
answered a year ago
0

Try this

      ValueYaml: !Sub |
        service:
          extraService: |
            HTTP_PORT    2020
profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions