Skip to content

Instantly share code, notes, and snippets.

View hagzag's full-sized avatar

Haggai Philip Zagury hagzag

View GitHub Profile
# Provider
variable "profile" {
description = "your default / custom aws profile see your ~/.aws/credentials file for details"
default = "tikal"
}
variable "region" {
description = "your default aws region"
default = "eu-west-1"
output "rds_addrs" {
value = "${join(",", data.dns_a_record_set.db-stg.addrs)}"
}
output "aws_db_snapshot_id" {
value = "${data.aws_db_snapshot.latest_db_snapshot.id}"
}
output "vpc_id" {
value = "${data.aws_vpc.prod.id}"
}
@hagzag
hagzag / main.tf
Last active October 26, 2018 09:38
# variables.tf ...
# Provider
variable "profile" {
description = "your default / custom aws profile see your ~/.aws/credentials file for details"
default = "tikal"
}
variable "region" {
description = "your default aws region"
kops create cluster \
--node-count 3 \
--zones eu-west-1a \
--master-zones eu-west-1a \
--node-size t2.medium \
--master-size t2.medium \
--ssh-public-key kops_rsa.pub \
--dns-zone=hub.tikal.io \
--name ${KOPS_CLUSTER_NAME}
NAME CLOUD ZONES
dev.hub.tikal.io aws eu-west-1a
NAME ROLE MACHINETYPE MIN MAX ZONES
master-eu-west-1a Master t2.medium 1 1 eu-west-1a
nodes Node t2.medium 3 3 eu-west-1a
kops get cluster && kops get --name $KOPS_CLUSTER_NAME instancegroups
kubectl cluster-info
Kubernetes master is running at https://api.dev.hub.tikal.io
Elasticsearch is running at https://api.dev.hub.tikal.io/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy
Heapster is running at https://api.dev.hub.tikal.io/api/v1/namespaces/kube-system/services/heapster/proxy
Kibana is running at https://api.dev.hub.tikal.io/api/v1/namespaces/kube-system/services/kibana-logging/proxy
KubeDNS is running at https://api.dev.hub.tikal.io/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
kops cluster update # for preview
kops cluster update --yes
kops replace -f ${KOPS_CLUSTER_NAME}-cluster.yaml
kops replace -f ${KOPS_CLUSTER_NAME}-ig.yaml`
mkdir ./specs
kops get cluster --name ${KOPS_CLUSTER_NAME} -o yaml > ./specs/${KOPS_CLUSTER_NAME}-cluster.yaml
kops get --name ${KOPS_CLUSTER_NAME} instancegroups -o yaml > ./specs/${KOPS_CLUSTER_NAME}-ig.yaml