Enable EKS IRSA

AWS Elastic Kubernetes Service  (EKS)  IAM Roles for Service Accounts (IRSA) authentication can be used to allow SingleStore cluster pods to communicate with S3 buckets (data, backup and pipelines).

This applies to Operator deployments only and is supported for SingleStore Engine version >= 8.5.

The following steps enable IRSA:

  1. Set the enable_eks_irsa global variable to ON.

  2. Create an IAM role with proper policies attached to choose which services the role can access and the scope of access for those services.

  3. Create a Kubernetes service account with annotation using the IAM role arn.

    apiVersion: v1
    kind: ServiceAccount
    metadata:  
      annotations:    
        eks.amazonaws.com/role-arn: arn:aws:iam::<aws_account_id>:role/<role_name>  
       name: <service_account_name> # Must be set to the name of the cluster
  4. Update the Memsql CR spec with the service account name from the step above.

    apiVersion: v1alpha1
    type: MemsqlCluster
    metadata:  
      name: <name> # This is the name of the cluster
    spec:  
      ...  
      serviceAccountName: <service_account_name>  
      backupSpec:    
        credsMode: "eks_irsa"    
        CloudServiceProvider: "AWS"    
        bucketName: "<bucket_name>"    
        s3Region: "<bucket_region; e.g. us-east-1>"
  5. Operator will restart the nodes and mount the JWT token to each node.

  6. Update the SQL statements to use the hint creds_mode: eks_irsa

    • Data:

      CREATE LINK <db_name> AS S3 CREDENTIALS '{}' 
      CONFIG '{"region":"us-east-1", "creds_mode":"eks_irsa"}'
    • Pipelines:

      CREATE PIPELINE <pipeline_name> AS LOAD DATA S3 'path' 
      CONFIG '{"region": "us-east-1", "creds_mode": "eks_irsa"}
    • Backup:

      BACKUP DATABASE <db_name> TO S3 "<bucket_name/path>" 
      CONFIG '{"region":"us-east-1", “creds_mode”: “eks_irsa”}' CREDENTIALS '{}';
    • Restore:

      RESTORE DATABASE <db_name> FROM S3 'bucket_name/path' 
      CONFIG '{"region":"us-east-1", "creds_mode":"eks_irsa"}' CREDENTIALS '{}';

Last modified: December 13, 2024

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK