Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Samuel Magondu Njenga itsMagondu

🎯
Focusing
View GitHub Profile
@itsMagondu
itsMagondu / c3test.html
Created Sep 3, 2015
This is a test chart using c3
View c3test.html
<head>
<!-- Load c3.css -->
<link href="http://mamase.org/static/css/c3.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="chart"></div>
<!-- Load d3.js and c3.js -->
<script src="http://mamase.org/static/js/d3.js" charset="utf-8"></script>
<script src="http://mamase.org/static/js/c3.js"></script>
<script>
@itsMagondu
itsMagondu / ingress-nginx.tf
Last active Aug 20, 2019
ingress-nginx teraform setup script
View ingress-nginx.tf
resource "kubernetes_namespace" "ingress_nginx" {
depends_on = ["google_container_node_pool.primary_preemptible_nodes"]
metadata {
name = "ingress-nginx"
labels = {
"app.kubernetes.io/name" = "ingress-nginx"
"app.kubernetes.io/part-of" = "ingress-nginx"
}
}
}
@itsMagondu
itsMagondu / metabase.tf
Last active Oct 1, 2020
A terraform script to setup metabase on GKE
View metabase.tf
resource "kubernetes_deployment" "metabase" {
metadata {
name = "metabase"
labels = {
app = "metabase"
}
namespace = "${kubernetes_namespace.sandbox.metadata.0.name}"
}
spec {
replicas = 1
@itsMagondu
itsMagondu / gke_cluster.tf
Last active Aug 20, 2019
Setup a Kubernetes cluster on GCP. Initialize the terraform kubernetes provider too.
View gke_cluster.tf
resource "google_container_cluster" "primary" {
project = "${var.project_id}"
name = "demo-cluster"
location = "${var.zone}"
remove_default_node_pool = true
initial_node_count = 1
master_auth {
username = "${var.k8s_username}"
View gke-variables.tf
variable project_id {}
variable cloudsql_proxy_sa_key {}
variable zone {}
variable k8s_username {}
variable k8s_password {}
variable db_instance_connection_name {}
variable metabase_db_name {}
variable metabase_db_user {}
variable metabase_db_password {}
@itsMagondu
itsMagondu / sql-outputs.tf
Created Aug 20, 2019
Terraform outputs for CloudSQL
View sql-outputs.tf
output "metabase_db_name" {
value = "${google_sql_database.metabase_database.name}"
}
output "db_instance_connection_name" {
value = "${google_sql_database_instance.demo_instance.connection_name}"
}
@itsMagondu
itsMagondu / cloudsql-variables.tf
Created Aug 20, 2019
Terraform input variables for CloudSQL
View cloudsql-variables.tf
variable project_id {}
variable region {}
variable metabase_db_user {}
variable metabase_db_password {}
@itsMagondu
itsMagondu / cloudsql-instance.tf
Created Aug 20, 2019
Setup CloudSQL db using terraform
View cloudsql-instance.tf
resource "google_sql_database_instance" "demo_instance" {
project = "${var.project_id}"
name = "demo-db"
region = "${var.region}"
database_version = "POSTGRES_9_6"
settings {
tier = "db-f1-micro"
disk_autoresize = true
@itsMagondu
itsMagondu / gcp-outputs.tf
Created Aug 20, 2019
Terraform outputs for GCP project
View gcp-outputs.tf
output "project_id" {
value = "${google_project.demo_project.project_id}"
}
output "cloudsql_proxy_sa_key" {
value = "${google_service_account_key.cloudsql_proxy_sa_key.private_key}"
}
@itsMagondu
itsMagondu / gcp-project.tf
Created Aug 20, 2019
Create a GCP project using terraform
View gcp-project.tf
provider "google" {
project = "${var.project}"
zone = "${var.zone}"
}
resource "google_project" "demo_project" {
name = "${var.project}"
project_id = "${var.project}-id"
org_id = "${var.org_id}"
billing_account = "${var.billing_id}"
You can’t perform that action at this time.