File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,6 +119,14 @@ resource "kubernetes_deployment" "deployment" {
119119 }
120120 }
121121 }
122+
123+ dynamic "volume_mount" {
124+ for_each = each. value . mount_secrets
125+ content {
126+ name = volume_mount. key
127+ mount_path = volume_mount. value
128+ }
129+ }
122130 }
123131
124132 dynamic "init_container" {
@@ -158,6 +166,25 @@ resource "kubernetes_deployment" "deployment" {
158166 }
159167 }
160168 }
169+
170+ dynamic "volume_mount" {
171+ for_each = init_container. value . mount_secrets
172+ content {
173+ name = volume_mount. key
174+ mount_path = volume_mount. value
175+ }
176+ }
177+ }
178+ }
179+
180+ dynamic "volume" {
181+ for_each = each. value . mount_secrets
182+
183+ content {
184+ name = volume. key
185+ secret {
186+ secret_name = volume. key
187+ }
161188 }
162189 }
163190 }
Original file line number Diff line number Diff line change @@ -28,12 +28,14 @@ variable "services" {
2828 env_from_secrets = optional (list (string ))
2929 env_from_field = optional (map (string ))
3030 env = optional (map (string ))
31+ mount_secrets = optional (map (string ))
3132 init_container = optional (object ({
3233 image = optional (string )
3334 command = list (string )
3435 env_from_secrets = optional (list (string ))
3536 env_from_field = optional (map (string ))
3637 env = optional (map (string ))
38+ mount_secrets = optional (map (string ))
3739 }))
3840 })
3941 )
Original file line number Diff line number Diff line change @@ -34,12 +34,14 @@ variable "services" {
3434 env_from_secrets = optional (list (string ))
3535 env_from_field = optional (map (string ))
3636 env = optional (map (string ))
37+ mount_secrets = optional (map (string ))
3738 init_container = optional (object ({
3839 image = optional (string )
3940 command = list (string )
4041 env_from_secrets = optional (list (string ))
4142 env_from_field = optional (map (string ))
4243 env = optional (map (string ))
44+ mount_secrets = optional (map (string ))
4345 }))
4446 })
4547 )
You can’t perform that action at this time.
0 commit comments