Created
May 11, 2022 17:24
-
-
Save sergsoares/f2ad79ca08a81d302530b0ed7e67ff9d to your computer and use it in GitHub Desktop.
Example of deployment with Kubernetes provider for terraform (kubectl_manifest)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kubectl_manifest" "node0_deployment" { | |
apply_only = true | |
wait_for_rollout = false | |
yaml_body = <<YAML | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: ${local.node0} | |
namespace: ${local.namespace} | |
labels: | |
app: ${local.node0} | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: ${local.node0} | |
template: | |
metadata: | |
labels: | |
app: ${local.node0} | |
spec: | |
containers: | |
- name: ${local.node0} | |
image: ${local.node_image} | |
ports: | |
- containerPort: ${local.port} | |
YAML | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment