Add a preemptible node

To reduce the costs, you can run PHP pods on cheaper nodes.

Google has Preemptible machines that are up to 3 times cheaper than the normal ones, but they have the disadvantage that they only last for 24 hours. However, by using multiple pods for your site, this will make the PHP component of your site highly available, thus your site will not be affected by the restart of the machines.

To add a preemptible node pool, go to your cluster page in Google Kubernetes Engine and click ADD NODE POOL.

Then make sure to check Enable preemptible nodes from Nodes - Machine Configuration. Keep in mind that your machine type should have at least 4 vCPU and 15 GB memory, for example n1-standard-4, n2-standard-4 etc.

Add a preemptible node

The Presslabs Dashboard allows using the preemptible nodes from Google Cloud. You can schedule WordPress , Memcached pods , and MySQL pods to run on preemptible machines.

1. Schedule WordPress preemptible machines

In order to schedule the WordPress pods to use preemptible machines, go to Site -> Resources and choose the WordPress tab:

Resources - WordPress tab

Scroll down to Scheduling Rules, then click on the ADD A NEW RULE button:

WordPress tab - add new preemptible rule

This will allow you to select your node, and you need to choose the preemptible node label you've created:

Select the preemptible rule

Finally check the Scheduling Mode to make sure you've set it properly. You have the following options:

  • Always - Only preemptible nodes are chosen for scheduling pods.
  • Prefer - If there are preemptible nodes available they are chosen for scheduling pods.
  • Never - Only standard nodes are chosen for scheduling pods.

2. Schedule Memcached preemptible machines

Similarly to the scheduling of the WordPress pods to use preemptible machines, you can set scheduling rules for Memcached nodes. The steps are the same as above, just take care to select the Memcached tab.

Schedule Memcached preemptible machines

3. Schedule Memcached preemptible machines


It's not highly recommended to schedule the MySQL pods to run on preemptible nodes, because your site performance will be affected by the restart of these nodes.

To schedule the MySQL nodes to use preemptible machines, go to Projects -> Database and choose the Resource Allocation tab.

Database - Resource allocation tab

Following the same process described above, go to the Scheduling Rules section and click on the ADD A NEW RULE button and simply select the option preemptible from the drop-down list.

Schedule preemptible MySQL pods

Don’t forget to verify the Scheduling Mode, to be set properly.

See Also

Add custom init containers

If you want to run migrations or perform other operations that are required before your site starts, [...]

Configure ProxySQL

Sometimes you will need to set custom variables in ProxySQL configuration or you will want to cache [...]

Increase the default limit range resources

Presslabs Dashboard has default limit ranges for memory and CPU, which you can modify to accommodate [...]

Invite a user to your organization

You can invite users to your organization, which will give them access to all the projects and sites [...]