- Terraform - Installation Instructions
- Helm - Installation Instructions
- Draft - Installation Instructions
- kubectl - Installation Instructions
- Docker - Installation Instructions
- Azure CLI - Installation Instructions
resource "azurerm_resource_group" "test" {
name = "my_terraform_k8s"
location = "West Europe"
}
resource "azurerm_kubernetes_cluster" "test" {
name = "aks-terraform"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
dns_prefix = "acstestagent1"
linux_profile {
admin_username = "azureuser"
ssh_key {
key_data = "${YOUR_SSH_KEY}"
}
}
agent_pool_profile {
name = "default"
count = 1
vm_size = "Standard_DS1_v2"
os_type = "Linux"
os_disk_size_gb = 30
}
service_principal {
client_id = "${SPN_APP_ID}"
client_secret = "${SPN_PASSWORD}"
}
tags {
Environment = "Production"
}
}
# run this inside your terraform configuration directory
terraform init
terraform plan -out=tfplan -input=false
terraform apply tfplan
# run this inside your terraform configuration directory
terraform destroy .
az aks get-credentials -n aks-terraform -g my_terraform_k8s
# if this is the first time you are using helm, please uncomment the line below.
# helm init
helm install --name jenkins stable/jenkins
# Alternatively, if you are having issues with the persistant volume class, you can still install jenkins from the chart provided in this repo:
# helm install --name jenkins jenkins-helm/.
# or to pass the storage class parameter:
helm install --name jenkins stable/jenkins --set Persistence.StorageClass=default
# the provided chart also Adds ACI plugin and Azure AD plugin (needs to be configured though)
printf $(kubectl get secret --namespace default jenkins-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
git clone https://github.com/idanshahar/K8SCodeComponentsMeetup.git
cd KubernetesCodeComponents/jenkins
docker build . --tag ${YOUR_DOCKER_REGISTRY}:${TAG}
docker push ${YOUR_DOCKER_REGISTRY}:${TAG}
Go to "Manage Jenkins" -> "Configure System"
- Under Container Template, change the Docker Image to: idanshahar/jenkins-slave:latest
- Add the following host path volumes: /var/run/docker.sock, /usr/bin/docker
- Create a new Pipeline job and select the jenkins file from git
- Change kubernetes url to 10.0.0.1
Go to "Credentials" -> "System" -> "Global credentials" -> "Add Credentials"
- Choose "Global" Scope
- Add your Dockerhub credentials
- Insert 'docker-hub-credentials' as the credentialls ID
# cd to your app root folder
cd node-draft
draft init #initialize draft
draft config set registry $DockerHubUsername
draft create
draft up