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
| apiVersion: configuration.konghq.com/v1 | |
| kind: KongIngress | |
| metadata: | |
| name: api-configuration | |
| upstream: | |
| hash_on: none | |
| hash_fallback: none | |
| healthchecks: | |
| active: | |
| concurrency: 10 |
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
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: api | |
| labels: | |
| app: api | |
| spec: | |
| rules: | |
| - host: api.gengo.dev | |
| http: |
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
| HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname` | |
| SERVER=$1 | |
| TOKEN=$2 | |
| curl -s --insecure -k -v -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -XPATCH -d '{"spec":{"unschedulable":true}}' -H "Content-Type: application/merge-patch+json" $SERVER/api/v1/nodes/$HOSTNAME | |
| for each in $(curl -s -k -H "Authorization: Bearer $TOKEN" --insecure -XGET $SERVER/api/v1/namespaces | jq -r '.items[].metadata.name'); | |
| do arr=($(curl -s -k -H "Authorization: Bearer $TOKEN" --insecure -XGET $SERVER/api/v1/namespaces/$each/pods | jq --arg node $HOSTNAME -r '.items[] | select(.spec.nodeName == $node) | .metadata.name')); | |
| for i in ${arr[@]}; |
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
| SERVER=$1 | |
| HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname` | |
| TOKEN=$2 | |
| $KEY="node-role" | |
| $VALUE="applications" | |
| while true; do | |
| if curl -s --insecure -k -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" $SERVER/api/v1/nodes | grep $HOSTNAME |
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
| # source code | |
| # shamelessly copied from | |
| # https://stackoverflow.com/a/31464349/2591014 | |
| import signal | |
| import time | |
| class GracefulKiller: | |
| kill_now = False | |
| signals = { |
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
| chef-solo --lockfile /tmp/chef-1.pid -c ../path/to/your/solo-test.rb -E staging -o your-cookbooks::recipe >> /tmp/chef.log 2>&1 || exit 1 & | |
| chef-solo --lockfile /tmp/chef-2.pid -c ../path/to/your/solo-test.rb -E live -o your-cookbooks::anotherrecipe >> /tmp/chef.log 2>&1 || exit 1 & | |
| chef-solo --lockfile /tmp/chef-3.pid -c ../path/to/your/solo-test.rb -E dev -o your-cookbooks::anootheronerecipe >> /tmp/chef.log 2>&1 || exit 1 & | |
| wait | |
| has_errors = `grep -rn "ERROR" /tmp/chef.log` | |
| if [ ! -z "$has_errors" ]; then | |
| echo -e "Error occured" | |
| cat /tmp/chef.log | |
| rm /tmp/chef.log |
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 | |
| chef-solo -c ../path/to/your/solo-test.rb -E staging -o your-cookbooks::recipe || exit 1 | |
| chef-solo -c ../path/to/your/solo-test.rb -E staging -o your-cookbooks::another_recipe || exit 1 |
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
| dist: xenial | |
| sudo: true | |
| install: | |
| - "curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -v 14.7.17" | |
| script: | |
| - "chmod +x run_tests.sh" | |
| - "./run_tests.sh" |
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
| base = File.expand_path('..', __FILE__) | |
| nodes_path File.join(base, '/../nodes') | |
| role_path File.join(base, '/../roles') | |
| data_bag_path File.join(base, '/../data_bags') | |
| encrypted_data_bag_secret File.join(base, '/../data_bag_key') | |
| environment_path File.join(base, '/../environments') | |
| ssl_verify_mode :verify_peer | |
| solo_legacy_mode true |
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
| aws --version # make sure it is 1.16 and up | |
| # aws-cli/1.16.192 Python/3.7.3 Darwin/18.2.0 botocore/1.12.182 | |
| aws rds create-db-instance-read-replica \ | |
| --db-instance-identifier main-db \ | |
| --source-db-instance-identifier [arn resource url of the source] \ | |
| --db-subnet-group-name [subnet in a different VPC] \ | |
| --vpc-security-group-ids [security group in a different VPC] |