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
| # Create the cluster | |
| resource "digitalocean_kubernetes_cluster" "dev-k8s" { | |
| name = "dev-k8s" | |
| region = "nyc1" | |
| version = "1.14.1-do.2" | |
| node_pool { | |
| name = "dev-k8s-nodes" | |
| size = "s-1vcpu-2gb" | |
| node_count = 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
| # Create a load balancer associated with our cluster | |
| resource "digitalocean_loadbalancer" "public" { | |
| name = "loadbalancer-1" | |
| region = "nyc1" | |
| forwarding_rule { | |
| entry_port = 80 | |
| entry_protocol = "http" | |
| target_port = 30000 |
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
| # Export the kubectl configuration file | |
| resource "local_file" "kubernetes_config" { | |
| content = "${digitalocean_kubernetes_cluster.dev-k8s.kube_config.0.raw_config}" | |
| filename = "kubeconfig.yaml" | |
| } | |
| # Print the load balancer ip | |
| output "digitalocean_loadbalancer" { | |
| value = "${digitalocean_loadbalancer.public.ip}" | |
| description = "The public IP address of the load balancer." |
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
| language: go | |
| services: | |
| - docker | |
| before_install: | |
| - docker build --no-cache -t ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT} . | |
| - docker run ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT} /go/src/github.com/kainlite/whatismyip-go/whatismyip-go.test | |
| - docker run -d -p 127.0.0.1:8000:8000 ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT} |
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: v1 | |
| clusters: | |
| - cluster: | |
| certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURKekNDQWcrZ0F3SUJBZ0lDQm5Vd0RRWUpLb1pJaHZjTkFRRUxCUUF3TXpFVk1CTUdBMVVFQ2hNTVJHbG4KYVhSaGJFOWpaV0Z1TVJvd0dBWURWUVFERXhGck9ITmhZWE |
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: v1 | |
| kind: Service | |
| metadata: | |
| name: whatismyip-go-service | |
| spec: | |
| type: NodePort | |
| ports: | |
| - port: 8000 | |
| targetPort: 8000 |
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
| $ curl -v 142.93.207.200:30000 | |
| * Trying 142.93.207.200... | |
| * TCP_NODELAY set | |
| * Connected to 142.93.207.200 (142.93.207.200) port 30000 (#0) | |
| > GET / |
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
| $ curl -v 159.203.156.153 | |
| * Trying 159.203.156.153... | |
| * TCP_NODELAY set | |
| * Connected to 159.203.156.153 (159.203.156.153) port 80 (#0) | |
| > GET / HTTP/1.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
| $ kubectl get pods --kubeconfig=./kubeconfig.yaml | |
| NAME READY STATUS RESTARTS AGE | |
| whatismyip-go-deployment-5ff9894d8c-f48nx 1/1 Running 0 9s |
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
| # Initialize terraform | |
| $ terraform init | |
| Initializing provider plugins... | |
| - Checking for available provider plugins on https://releases.hashicorp.com... |