Skip to content

Instantly share code, notes, and snippets.

@sergsoares
Created May 11, 2022 17:24
Show Gist options
  • Save sergsoares/f2ad79ca08a81d302530b0ed7e67ff9d to your computer and use it in GitHub Desktop.
Save sergsoares/f2ad79ca08a81d302530b0ed7e67ff9d to your computer and use it in GitHub Desktop.
Example of deployment with Kubernetes provider for terraform (kubectl_manifest)
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