Deploy WordPress on Oracle Linux with MySQL HeatWave in Oracle Cloud Infrastructure (OCI) using Terraform.
The default wordpress_deployment_mode = "compute" creates the existing Oracle Linux Compute deployment. Set wordpress_deployment_mode = "oke" to create an Oracle Kubernetes Engine (OKE) cluster and private worker node pool instead. The OKE path retains MySQL HeatWave and puts the Kubernetes service load balancer in the public subnet.
OKE needs a Kubernetes version supported by the target OCI region. For example:
wordpress_deployment_mode = "oke"
oke_kubernetes_version = "<supported OKE version>"After terraform apply, write the sensitive outputs to protected files and deploy the rendered WordPress workload:
terraform output -raw oke_kubeconfig > kubeconfig
terraform output -raw oke_wordpress_manifest > wordpress-oke.yaml
KUBECONFIG="$PWD/kubeconfig" kubectl apply -f wordpress-oke.yaml
KUBECONFIG="$PWD/kubeconfig" kubectl get service wordpress -n wordpressThe manifest creates a one-time job to create the WordPress database and user in HeatWave, then deploys the official WordPress image behind an OCI load balancer. It defaults to one replica because uploads use container-local storage. Add shared storage (for example OCI File Storage) before running multiple replicas in production.
For managed networking, the OKE mode adds an Internet-facing TCP 6443 security rule for the public Kubernetes API endpoint. If you supply an existing public subnet and security lists, allow TCP 6443 from your administrator network before applying; restrict it to your approved CIDR range after initial setup.
The same modules are used as Resource Manager Stack.
The latest stack can be downloaded directly in the releases (the zip file)