Junior
Con quali risorse è possibile creare pod in Kubernetes?
sobes.tech AI
Risposta dell'AI
- Deployment
- StatefulSet
- DaemonSet
- ReplicaSet
- Job
- CronJob
- Manualmente, usando
kubectl apply -f pod.yamlokubectl run - Risorse personalizzate, che definiscono i propri controller, creando pod
# Esempio di creazione di un pod tramite manifest Pod
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx:latest
# Esempio di creazione di pod tramite Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
replicas: 3 # Numero di pod
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: nginx:latest