By default the Kubernetes worker node is set to use a DHCP address for its networking, this can be altered by providing a CloudInit customization specification which will run as part of the deployment of the worker node.

Note:

Note that the default worker node is based on VMware Photon and therefore the CloudInit script is specific to configuring the network information, if you customize the default worker node to your own linux distribution, the changes below will need to refect the CloudInit data for your operating system.

To enable a static IP for your worker node you can provide a worker node yaml manifest in your git repository, an example is provided below and also available in the ECSExample git repository.

apiVersion: vmoperator.vmware.com/v1alpha1
kind: VirtualMachineClass
metadata:
  name: best-effort-ec-small
spec:
  controllerName: vmoperator.vmware.com/ecworker
  hardware:
    cpus: 2
    memory: 8Gi
---
apiVersion: v1
kind: Namespace
metadata:
  name: ec-system
---
apiVersion: vmoperator.vmware.com/v1alpha1
kind: VirtualMachine
metadata:
  name: ec-worker
  namespace: ec-system
spec:
  className: best-effort-ec-small
  imageName: ec-wrkr.ova
  powerState: poweredOff
  vmMetadata:
    transport: CloudInit
    configMapName: worker-config
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: worker-config
  namespace: ec-system
data:
  networkconfig: |
        version: 2
        ethernets:
            eth0:
                dhcp: "false"
                addresses:
                    - 10.211.34.144/22
                nameservers:
                    addresses:
                        - 10.211.56.141
                        - 10.211.81.141
                routes:
                    - to: 0.0.0.0/0
                      via: 10.211.32.1