Skip to content

Instantly share code, notes, and snippets.

View nicosingh's full-sized avatar

Nico Singh nicosingh

View GitHub Profile
# 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" {
resource "aws_acm_certificate" "certificate" {
certificate_body = acme_certificate.certificate.certificate_pem
private_key = acme_certificate.certificate.private_key_pem
certificate_chain = acme_certificate.certificate.issuer_pem
}
#!/bin/bash
amazon-linux-extras install nginx1 -y
chkconfig nginx on
service nginx start
# . . . remaining part of /etc/gitlab-runner/config.toml
[runners.machine]
MachineDriver = "azure"
MachineName = "gitlab-docker-machine-%s"
MachineOptions = [
"azure-subscription-id=xxx",
"azure-client-id=xxx",
"azure-client-secret=xxx",
"azure-resource-group=gitlab-ci",
# . . . remaining part of /etc/gitlab-runner/config.toml
[runners.machine]
MachineDriver = "google"
MachineName = "gitlab-docker-machine-%s"
MachineOptions = [
"google-project=xxxxx",
"google-network=xxxxx",
"google-subnetwork=xxxxx",
"google-use-internal-ip=true",