Learn KOP - AWS Secrets Manager Blueprint - Rafay Product Documentation

Part 2: Blueprint

What Will You Do

In this part of the self-paced exercise, you will create a custom cluster blueprint with the Secret Store CSI Driver managed add-on and apply the blueprint to the EKS cluster.


Step 1: Create Blueprint

In this step, you will create a custom cluster blueprint with the Secret Store CSI Driver managed add-on.

Next, you will create a version for the blueprint.

You will then see the created blueprint with version.


Step 2: Apply Blueprint

In this step, you will apply the newly created custom cluster blueprint to the previously provisioned EKS cluster. The blueprint contains the Secret Store CSI Driver managed add-on.

You will see the new blueprint being applied to the cluster


Step 3: Create AWS Secrets Manager Store

In this step, you will create secrets in AWS Secrets Manager that will be used by our sample workload in a later step.


Step 4: Create Namespace

In this step, you will create a namespace for the workload and the IRSA. The AWS Secrets Manager secrets are only accessible to the specific namespace where the IRSA is created.


Step 5: Create IRSA

In this step, you will create an IRSA so that the workload pods on the EKS cluster will have the necessary permissions to access AWS Secrets Manager. In AWS, it is a recommended best practice to use IAM roles for service accounts (IRSA) to access AWS services outside the EKS cluster because of the following benefits:

Benefit Description
Least Privilege No longer need to provide extended permissions to the node IAM role so that pods on that node can call AWS APIs. You can scope IAM permissions to a service account, and only pods that use that service account have access to those permissions. This feature also eliminates the need for third-party solutions such as kiam or kube2iam.
Credential Isolation A container can only retrieve credentials for the IAM role that is associated with the service account to which it belongs. A container never has access to credentials that are intended for another container that belongs to another pod.
Auditability Access and event logging is available through CloudTrail to help ensure retrospective auditing.

You will now create the IRSA on the EKS cluster.

{
    "Version": "2012-10-17",
    "Statement": [ {
        "Effect": "Allow",
        "Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"],
        "Resource": ["arn:aws:secretsmanager:us-west-2:679196755555:secret:get-started-secret-N23aVd"]
    } ]
}

It may take a few minutes for the service account to be created and display in the UI.


Step 6: Create Secret Provider Class

In this step, you will create a secret provider class. The class is used to specify which secrets can be accessed by the application workload.

In order to use the Secrets Store CSI driver, you have to create a SecretProviderClass custom resource. The SecretProviderClass is a namespaced resource in Secrets Store CSI Driver that is used to provide driver configurations and provider-specific parameters to the CSI driver. It must be in the same namespace as the pod referencing it.

Note: All keys in the Secrets Manager store are available in a single file. Adding each key individually creates a separate file for that key/value pair on the pod.


Recap

Congratulations! At this point, you have successfully created a custom blueprint, IRSA, and AWS Secrets Manager store.

Next, you will create a workload within the previously created namespace that will access the secrets using the IRSA and secret provider class.