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
import asyncio | |
import aiohttp | |
import os | |
import base64 | |
from urllib.parse import urlencode, urlunparse | |
import requests | |
def fetch_auth_header(azdo_pat: str) -> str: | |
pat = azdo_pat |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"time" |
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
resource "null_resource" "fetch_kubeconfig" { | |
provisioner "local-exec" { | |
command = "scp -i ~/.ssh/k8s-lab.pem admin@${aws_instance.kube_master.public_ip}:~/.kube/config ~/.kube/config && sed -i '/server/c\\ server: https://${aws_instance.kube_master.public_ip}:6443' ~/.kube/config" | |
} | |
} |
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
--- | |
- hosts: all | |
remote_user: admin | |
become: true | |
tasks: | |
- name: Install packages that allow apt to be used over HTTPS | |
apt: | |
name: "{{ packages }}" | |
state: present | |
update_cache: yes |
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
terraform { | |
backend "local" { | |
path = "state/terraform.tfstate" | |
} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.0" | |
} |
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
provisioner "remote-exec" { | |
connection { | |
host = self.public_ip | |
user = "admin" | |
private_key = file("~/.ssh/k8s-lab.pem") | |
} | |
inline = ["echo 'Instance ${self.public_dns} is up!'"] | |
} | |
provisioner "local-exec" { |
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
# Setting up master node | |
resource "aws_instance" "kube_master" { | |
ami = "ami-02e2a5679226e293c" # ID of default Debian 10 ami (64-bit|x86) | |
instance_type = "t2.micro" # To keep it free tier eligible we will be using t2.micro | |
tags = { | |
Name = "kube-master" | |
} | |
key_name = "k8s-lab" | |
} |
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
terraform { | |
backend "local" { | |
path = "state/terraform.tfstate" | |
} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.0" | |
} |
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
terraform { | |
backend "local" { | |
path = "state/terraform.tfstate" | |
} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.0" | |
} |