Pod

Example

Here’s an example of a Pod.

.kubes/resources/shared/pod.rb

name "busybox1"
hostname "busybox-1"
subdomain "default-subdomain"
containers([
  image: "busybox:1.28",
  command: ["sleep", "3600"],
  name: "busybox",
])

Produces:

.kubes/output/shared/pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: busybox1
spec:
  containers:
  - image: busybox:1.28
    command:
    - sleep
    - '3600'
    name: busybox
  hostname: busybox-1
  subdomain: default-subdomain

DSL Methods

Here’s a list of more common methods:

  • activeDeadlineSeconds
  • affinity
  • automountServiceAccountToken
  • containers
  • dnsConfig
  • dnsPolicy
  • enableServiceLinks
  • ephemeralContainers
  • hostAliases
  • hostIPC
  • hostNetwork
  • hostPID
  • hostname
  • imagePullSecrets
  • initContainers
  • nodeName
  • nodeSelector
  • overhead
  • preemptionPolicy
  • priority
  • priorityClassName
  • readinessGates
  • restartPolicy
  • runtimeClassName
  • schedulerName
  • securityContext
  • serviceAccount
  • serviceAccountName
  • shareProcessNamespace
  • subdomain
  • terminationGracePeriodSeconds
  • tolerations
  • topologySpreadConstraints
  • volumes

For a full list of the available methods, refer to the source itself syntax/pod.rb.