Skip to content

Instantly share code, notes, and snippets.

@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-values.yaml
Created August 21, 2024 10:10
This gist contains code from the helm/s3-csi-demo/values.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
storageClass:
name: s3-storageclass
provisioner: s3.csi.aws.com # Provisioner for AWS S3
parameters:
type: standard
persistentVolume:
name: s3-pv
capacity:
storageSize: 5Gi
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-nginx.yaml
Created August 21, 2024 10:05
This gist contains code from the helm/s3-csi-demo/templates/nginx.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: Pod
metadata:
name: {{ .Values.nginx.name }}
labels:
{{- with .Values.nginx.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
containers:
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-pvc.yaml
Created August 21, 2024 10:00
This gist contains code from the helm/s3-csi-demo/templates/s3-storageclass.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.persistentVolumeClaim.name }}
spec:
accessModes:
- {{ .Values.persistentVolumeClaim.accessModes }}
storageClassName: {{ .Values.persistentVolumeClaim.storageClassName }}
resources:
requests:
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-pv.yaml
Created August 21, 2024 09:52
This gist contains code from the helm/s3-csi-demo/templates/pv.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.persistentVolume.name }}
spec:
capacity:
storage: {{ .Values.persistentVolume.capacity.storageSize }}
volumeMode: {{ .Values.persistentVolume.volumeMode }}
accessModes:
- {{ .Values.persistentVolume.accessModes }}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-s3-storageclass.yaml
Created August 21, 2024 09:48
This gist contains code from the helm/s3-csi-demo/templates/s3-storageclass.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
provisioner: {{ .Values.storageClass.provisioner }} # Provisioner for AWS S3
parameters:
type: {{ .Values.storageClass.parameters.type }}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-outputs-03.tf
Created August 18, 2024 12:09
This gist contains code from the eks/outputs.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
output "cluster_auth_token" {
description = "Amazon Elastic Kubernetes Service Cluster Authentication Token"
value = data.aws_eks_cluster_auth.eks_cluster.token
}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-outputs-02.tf
Created August 18, 2024 12:08
This gist contains code from the eks/outputs.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
output "cluster_ca_certificate" {
description = "Amazon Elastic Kubernetes Service Cluster CA Certificate"
value = aws_eks_cluster.eks_cluster.certificate_authority[0].data
}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-outputs-01.tf
Created August 18, 2024 12:08
This gist contains code from the eks/outputs.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
output "cluster_endpoint" {
description = "Amazon Elastic Kubernetes Service Cluster Endpoint"
value = aws_eks_cluster.eks_cluster.endpoint
}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-s3-csi-04.tf
Created August 18, 2024 12:05
This gist contains code from the eks/s3-csi.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
resource "aws_eks_addon" "s3_csi" {
cluster_name = aws_eks_cluster.eks_cluster.name
addon_name = "aws-mountpoint-s3-csi-driver"
addon_version = data.aws_eks_addon_version.s3_csi.version
service_account_role_arn = aws_iam_role.s3_csi.arn
resolve_conflicts_on_create = "OVERWRITE"
tags = {
Name = "${var.eks.cluster_name}-aws-mountpoint-s3-csi-driver"
}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-s3-csi-03.tf
Created August 18, 2024 12:05
This gist contains code from the eks/s3-csi.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
resource "aws_iam_role_policy_attachment" "s3_csi" {
policy_arn = aws_iam_policy.s3_csi_bucket_policy.arn
role = aws_iam_role.s3_csi.name
}