Skip to content

Objects parameters

Un Pod esegue un singolo container o un piccolo gruppo di container. È l'unità minima di deploy su Kubernetes.

* `apiVersion`: Versione API dell’oggetto (es. `v1`)
* `kind`: Pod
* `metadata`:
    * `name`
    * `namespace`
    * `labels`
    * `annotations`

* `spec`:
    * `containers[]`:
        * `name`
        * `image`
        * `ports[]`
        * `env[]`
        * `resources`:
            * `requests`
            * `limits`
        * `livenessProbe`
        * `readinessProbe`
        * `startupProbe`
        * `volumeMounts[]`
    * `volumes[]`
    * `restartPolicy`
    * `nodeSelector`
    * `affinity`
    * `tolerations[]`

Un Deployment gestisce ReplicaSet di Pod e permette aggiornamenti rolling e rollback.

* `apiVersion`: apps/v1
* `kind`: Deployment
* `metadata`:
    * `name`
    * `namespace`
    * `labels`
    * `annotations`

* `spec`:
    * `replicas`
    * `revisionHistoryLimit`
    * `selector.matchLabels`
    * `strategy.type`
    * `strategy.rollingUpdate.maxUnavailable`
    * `strategy.rollingUpdate.maxSurge`
    * `template`:
        * `metadata.labels`
        * `spec`: (struttura Pod)

Uno StatefulSet gestisce Pod con identità stabili e volumi persistenti.

* `apiVersion`: apps/v1
* `kind`: StatefulSet
* `metadata`:
    * `name`
    * `namespace`
    * `labels`
    * `annotations`

* `spec`:
    * `serviceName`
    * `replicas`
    * `podManagementPolicy`
    * `selector.matchLabels`
    * `updateStrategy.type`
    * `template`:
        * `metadata.labels`
        * `spec`: (struttura Pod)
    * `volumeClaimTemplates[]`:
        * `metadata.name`
        * `spec.accessModes[]`
        * `spec.storageClassName`
        * `spec.resources.requests.storage`

Un DaemonSet garantisce che un Pod sia eseguito su tutti o alcuni nodi selezionati.

* `apiVersion`: apps/v1
* `kind`: DaemonSet
* `metadata`:
    * `name`
    * `namespace`
    * `labels`
    * `annotations`

* `spec`:
    * `selector.matchLabels`
    * `updateStrategy.type`
    * `template`:
        * `metadata.labels`
        * `spec`: (struttura Pod)

Un Job esegue Pod fino al completamento di un task, garantendo completamenti e retry.

* `apiVersion`: batch/v1
* `kind`: Job
* `metadata`:
    * `name`
    * `namespace`

* `spec`:
    * `parallelism`
    * `completions`
    * `backoffLimit`
    * `activeDeadlineSeconds`
    * `template`:
        * `metadata.labels`
        * `spec.restartPolicy`: OnFailure | Never
        * `spec.containers[]`: (struttura Pod)

Un CronJob esegue Job a intervalli programmati.

* `apiVersion`: batch/v1
* `kind`: CronJob
* `metadata`:
    * `name`
    * `namespace`

* `spec`:
    * `schedule`
    * `concurrencyPolicy`: Allow | Forbid | Replace
    * `startingDeadlineSeconds`
    * `successfulJobsHistoryLimit`
    * `failedJobsHistoryLimit`
    * `jobTemplate`:
        * `metadata.labels`
        * `spec.template`:
            * `metadata.labels`
            * `spec`: (struttura Pod)