Skip to content

Commit 512c5b5

Browse files
committed
Initial commit
0 parents  commit 512c5b5

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

section2-hol1/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## These files are for use only with Hands-on lab in the Terraform Cert Prep course on ACG
2+
## No guarantees are provided for it's working outside of the mentioned lab.
3+
4+

section2-hol1/main.tf

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
provider "kubernetes" {}
2+
3+
resource "kubernetes_deployment" "tf-k8s-deployment" {
4+
metadata {
5+
name = "tf-k8s-deploy"
6+
labels = {
7+
name = "terraform-k8s-deployment"
8+
}
9+
}
10+
11+
spec {
12+
replicas = 2
13+
14+
selector {
15+
match_labels = {
16+
name = "terraform-k8s-deployment"
17+
}
18+
}
19+
20+
template {
21+
metadata {
22+
labels = {
23+
name = "terraform-k8s-deployment"
24+
}
25+
}
26+
27+
spec {
28+
container {
29+
image = "nginx"
30+
name = "nginx"
31+
32+
}
33+
}
34+
}
35+
}
36+
}
37+
38+
39+
40+

section2-hol1/service.tf

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
resource "kubernetes_service" "tf-k8s-service" {
2+
metadata {
3+
name = "terraform-k8s-service"
4+
labels = {
5+
name = "tf-k8s-deploy"
6+
}
7+
}
8+
spec {
9+
port {
10+
port = 80
11+
target_port = 80
12+
node_port = 30080
13+
}
14+
type = "NodePort"
15+
}
16+
}

0 commit comments

Comments
 (0)