[Request]: container cluster create: kubeadm config patches, extra mounts, and node labels

Abierto
#2,498 1 comentario 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
kubernetes, swift

Línea de trabajo

Start with the container cluster create implementation and the related k8s plugin work in #2043; the issue does not name source files or tests. Compare the existing create options with the requested kubeadm patches, node mounts, labels, and readiness wait, then determine which configuration approach the project supports. Done means the selected create-time options are implemented and documented, with coverage for their behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Feature or enhancement request details

I've been trying container cluster create as a drop-in for Kind in a tool that spins up throwaway clusters to compare Kubernetes schedulers. Most of it maps over nicely (--node-image, --workers, write-config, --shared-image-store), but there are three Kind config features I couldn't find a way to express:

  • kubeadm config patches (Kind's kubeadmConfigPatches)
  • extra mounts into a node (Kind's per-node extraMounts)
  • node labels (Kind's per-node labels)

The concrete case: running kube-scheduler with a custom KubeSchedulerConfiguration. With Kind, that's a file mounted into the control-plane node plus a ClusterConfiguration patch that adds --config to the scheduler:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    extraMounts:
      - hostPath: ./kube-scheduler.yaml
        containerPath: /etc/kubernetes/scheduler-config.yaml
        readOnly: true
  - role: worker
    labels:
      example/role: system
kubeadmConfigPatches:
  - |
    apiVersion: kubeadm.k8s.io/v1beta4
    kind: ClusterConfiguration
    scheduler:
      extraArgs:
        - name: config
          value: /etc/kubernetes/scheduler-config.yaml
      extraVolumes:
        - name: scheduler-config
          hostPath: /etc/kubernetes/scheduler-config.yaml
          mountPath: /etc/kubernetes/scheduler-config.yaml
          readOnly: true
          pathType: File

Workaround today (container 1.7.1): after cluster create, container exec the config file into the node and rewrite /etc/kubernetes/manifests/kube-scheduler.yaml so kubelet restarts the static pod with --config. It works — /configz shows the custom profiles and the scheduler is Ready again in ~25s — but it restarts a control-plane component after bootstrap and relies on kubeadm's manifest layout. Labels are easy enough to add afterwards with kubectl label node, but mounts and patches really want to happen at create time.

What would help, either of:

  1. The --config <path> option mentioned under "Future Work" in #2043 — ideally accepting Kind's kind.x-k8s.io/v1alpha4 Cluster schema (or a documented subset of it), which would make porting existing Kind setups close to free.
  2. Or individual flags, something like:
    container cluster create --name lab \
      --kubeadm-config-patch ./scheduler-patch.yaml \
      --mount ./kube-scheduler.yaml:/etc/kubernetes/scheduler-config.yaml:ro \
      --workers count=1,label=example/role=system
    

A smaller related nicety: a --wait <duration> for node readiness, like kind create cluster --wait 180s, so scripts don't need a separate kubectl wait.

Related: #2043 (k8s plugin), #2468 (network/MTU options for cluster create), #2382 (skipping kube-proxy).

Code of Conduct
  • I agree to follow this project's Code of Conduct
Lenguaje dominante
Swift
Estrellas
51.9k
Forks
1.8k
Merge medio
2 d 3 h
PR fusionados (30 d)
27

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apple/container

Todos los issues de apple/container

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.