This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "template_file" "cluster_autoscaler" { | |
template = "${file("cluster_autoscaler.yml.tpl")}" | |
vars = { | |
worker_node_min_size = "${var.nodes_min_size}" | |
worker_node_max_size = "${var.nodes_max_size}" | |
worker_node_asg_name = "${aws_autoscaling_group.fd_eks_nodes_asg.name}" | |
aws_region = "${var.region}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "template_file" "cluster_autoscaler" { | |
template = "${file("cluster_autoscaler.yml.tpl")}" | |
vars = { | |
worker_node_min_size = "${var.nodes_min_size}" | |
worker_node_max_size = "${var.nodes_max_size}" | |
worker_node_asg_name = "${aws_autoscaling_group.fd_eks_nodes_asg.name}" | |
aws_region = "${var.region}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kustomize build deployments/staging/stagingvpc-shell-main/blue | kubectl apply -f - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make deployments/staging/stagingvpc-shell-main/blue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
bases: | |
- "./../base" | |
nameSuffix: "-stagingvpc-shell-main-blue" | |
commonLabels: | |
shell: stagingvpc-shell-main-blue | |
images: | |
- name: eagle | |
newName: someawsnumber.dkr.ecr.us-east-1.amazonaws.com/app-stg | |
newTag: FDx.x.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployments | |
βββ base # base from where everything is inherited | |
β βββ shell | |
β βββ bg | |
β β βββ bg-sidekiq.yaml | |
β β βββ bg-utility.yaml | |
β βββ fg | |
β β βββ app-api-public.yaml | |
β β βββ app-email.yaml | |
β β βββ app.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code gets the EKS endpoint IPs | |
endpoint = $eks_client.describe_cluster({name: eks_name}).data.cluster.endpoint | |
u = URI.parse(endpoint) | |
ips = [] | |
txt = Resolv::DNS.open do |dns| | |
records = dns.getresources(u.host, Resolv::DNS::Resource::IN::A) | |
records.each {|r| | |
ips << r.address.to_s | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the instance id | |
instance_id=$(curl http://169.254.169.254/latest/meta-data/instance-id 2> /dev/null) | |
# Get the instance name | |
instance_hostname=$(aws ec2 describe-instances --instance-ids $instance_id | jq -r '.Reservations[0].Instances[0].Tags[] | select(.Key == "opsworks:instance") | .Value') | |
# Get the instance ip | |
instance_ipaddress=$(aws ec2 describe-instances --instance-ids $instance_id | jq -r '.Reservations[0].Instances[0].PrivateIpAddress') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule DatabaseServer do | |
# start/0 is the fuction of the Databaserver | |
# that starts the server process by spawning | |
# loop/0 and returns its PID. | |
def start do | |
spawn(&loop/0) | |
end | |
# loop/0 is the fuction of the DatabaseServer | |
# that that basically waits to `receive` messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TestStreams do | |
def lines_lengths!(path) do | |
File.stream!(path) | |
|> Stream.map(&String.replace(&1, "\n","")) | |
|> Enum.map(&String.length(&1)) | |
end | |
def longest_line_length!(path) do | |
File.stream!(path) | |
|> Stream.map(&String.replace(&1, "\n", "")) |