NEW: kubernetes pod

This commit is contained in:
xpk 2020-07-28 16:47:08 +08:00
parent 80ca61e59c
commit 29bcb2fca2
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,2 @@
*tfstate*
provider.tf

View File

@ -0,0 +1,20 @@
resource "kubernetes_pod" "nginx" {
metadata {
name = "nginx-example"
labels = {
App = "nginx"
}
}
spec {
container {
image = "nginx:latest"
name = "example"
port {
container_port = 9080
}
}
}
}

View File

@ -0,0 +1,25 @@
variable "kubernetes_client_certificate"{
type = string
default = "xxx"
}
variable "kubernetes_client_key"{
type = string
default = "xxx"
}
variable "kubernetes_cluster_ca_certificate"{
type = string
default = "xxx"
}
provider "kubernetes" {
load_config_file = "false"
host = "https://192.168.86.51:6443"
client_certificate = base64decode(var.kubernetes_client_certificate)
client_key = base64decode(var.kubernetes_client_key)
cluster_ca_certificate = base64decode(var.kubernetes_cluster_ca_certificate)
}