-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not merge - traefik persistent volume #4
Changes from 1 commit
9cc9198
19daf93
df855fe
a25067e
61886ec
23e27eb
cde9a6e
979ff7f
0fdd80b
d789dcf
34fe528
9140482
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,46 @@ resource "kubernetes_service" "traefik_internal" { | |
} | ||
} | ||
|
||
|
||
|
||
|
||
resource "kubernetes_persistent_volume_claim" "persistent-volume-claim" { | ||
metadata { | ||
name = "persistent-volume-claim" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use name to ensure uniqueness "${var.name}-traefik-ingress" |
||
namespace = var.namespace | ||
} | ||
spec { | ||
access_modes = ["ReadWriteMany"] | ||
storage_class_name="standard" | ||
resources { | ||
requests = { | ||
storage = "5Gi" | ||
} | ||
} | ||
volume_name = "${kubernetes_persistent_volume.traefik-persistent-volume.metadata.0.name}" | ||
} | ||
} | ||
|
||
resource "kubernetes_persistent_volume" "traefik-persistent-volume" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to _ |
||
metadata { | ||
name = "traefik-persistent-volume" | ||
} | ||
spec { | ||
capacity = { | ||
storage = "10Gi" | ||
} | ||
storage_class_name="standard" | ||
access_modes = ["ReadWriteMany"] | ||
|
||
persistent_volume_source { | ||
vsphere_volume { | ||
volume_path = "/tmp/acme-certificates" | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
resource "kubernetes_deployment" "main" { | ||
metadata { | ||
name = "${var.name}-traefik-ingress" | ||
|
@@ -214,10 +254,6 @@ resource "kubernetes_deployment" "main" { | |
container { | ||
image = "${var.traefik-image.image}:${var.traefik-image.tag}" | ||
name = var.name | ||
volume_mount { | ||
name = "traefik-certs" | ||
mount_path = "/tmp/acme-certificates" | ||
} | ||
security_context { | ||
capabilities { | ||
drop = ["ALL"] | ||
|
@@ -332,7 +368,7 @@ resource "kubernetes_deployment" "main" { | |
volume { | ||
name = "traefik-certs" | ||
persistent_volume_claim { | ||
claim_name = kubernetes_persistent_volume_claim.persistent-volume-claim.name | ||
claim_name = kubernetes_persistent_volume_claim.persistent-volume-claim.metadata.0.name | ||
} | ||
} | ||
} | ||
|
@@ -359,61 +395,3 @@ resource "kubernetes_manifest" "tlsstore_default" { | |
} | ||
|
||
|
||
|
||
resource "kubernetes_storage_class" "traefik_certs_storage_class" { | ||
metadata { | ||
name = "traefik-certs-storage-class" | ||
|
||
} | ||
|
||
storage_provisioner = "kubernetes.io/aws-ebs" | ||
parameters = { | ||
type = var.storage_type | ||
iops = var.iops | ||
} | ||
reclaim_policy = var.reclaim_policy | ||
} | ||
|
||
resource "kubernetes_manifest" "traefik-persistent-volume" { | ||
manifest = { | ||
"apiVersion"= "v1", | ||
"kind"= "PersistentVolume", | ||
"metadata"= { | ||
"name"= "traefik-persistent-volume" | ||
|
||
}, | ||
"spec"= { | ||
"accessModes"= ["ReadWriteOnce"], | ||
"capacity"= { | ||
"storage"= "1Gi" | ||
}, | ||
"storageClassName"= "standard", | ||
"hostPath"= { | ||
"path"= "/tmp/acme-certificates" | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
resource "kubernetes_manifest" "persistent-volume-claim" { | ||
manifest = { | ||
"apiVersion"= "v1", | ||
"kind"= "PersistentVolumeClaim", | ||
"metadata"= { | ||
"name"= "persistent-volume-claim" | ||
"namespace" = var.namespace | ||
}, | ||
"spec"= { | ||
"accessModes"= ["ReadWriteOnce"], | ||
"resources"= { | ||
"requests"= { | ||
"storage"= "1Gi" | ||
} | ||
}, | ||
"storageClassName"= "standard", | ||
"volumeName"= "traefik-persistent-volume" | ||
} | ||
} | ||
|
||
} |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"persistent-volume-claim" - use _ and specify a bit more in the name, traefik_ingress_pvc should work