Skip to content

Instantly share code, notes, and snippets.

View nicosingh's full-sized avatar

Nico Singh nicosingh

View GitHub Profile
eks_pod_identity_associations = {}
eks_pod_identity_associations = {
"sample-apps-s3-readonly" = {
policy_arn = "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
service_account_name = "s3-readonly"
service_account_namespace = "sample-apps"
}
}
variable "eks_pod_identity_associations" {
type = map(any)
description = "Map of EKS Pod Associations to be created in EKS."
}
data "aws_iam_policy_document" "pod_identity" {
statement {
effect = "Allow"
principals {
@nicosingh
nicosingh / configure-gpu-server.sh
Created September 12, 2024 19:42
Create Audiobook from EPUB file in a GPU-based ubuntu 22.04 instance
sudo apt update
sudo apt install espeak-ng ffmpeg nvidia-cuda-toolkit python3-pip ubuntu-drivers-common -y
sudo ubuntu-drivers install
sudo apt autoremove
sudo apt clean
git clone https://github.com/aedocw/epub2tts
cd epub2tts
pip install .
sudo reboot
@nicosingh
nicosingh / main.tf
Last active September 28, 2024 17:56
# create EKS cluster
module "base" {
source = "./base/"
cluster_name = var.cluster_name
name_prefix = var.name_prefix
main_network_block = var.main_network_block
cluster_azs = var.cluster_azs
subnet_prefix_extension = var.subnet_prefix_extension
zone_offset = var.zone_offset
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sample-app-ingress-rules
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/group.name: my-app-eks
alb.ingress.kubernetes.io/load-balancer-name: my-app-eks
admin_users = ["thomas-gray", "ursula-williams"]
developer_users = ["melissa-oliver", "lex-oneil"]
# create some variables
variable "name_prefix" {
type = string
description = "Prefix to be used on each infrastructure object Name created in AWS."
}
variable "admin_users" {
type = list(string)
description = "List of Kubernetes admins."
}
variable "developer_users" {
spot_termination_handler_chart_name = "aws-node-termination-handler"
spot_termination_handler_chart_repo = "https://aws.github.io/eks-charts"
spot_termination_handler_chart_version = "0.21.0"
spot_termination_handler_chart_namespace = "kube-system"
# create some variables
variable "cluster_name" {
type = string
description = "EKS cluster name."
}
variable "cluster_endpoint" {
type = string
description = "Endpoint for your Kubernetes API server."
}
variable "cluster_certificate_authority_data" {