【问题标题】:Is there a way to install a kernel module on an AKS node in Azure Kubernetes?有没有办法在 Azure Kubernetes 的 AKS 节点上安装内核模块?
【发布时间】:2020-12-14 07:31:13
【问题描述】:

我正在尝试在我的 AKS 群集中的所有节点上安装 nfs-kernel-server 软件包。在 AKS Ubuntu 16.04 中默认未安装 NFS 的内核模块。我在这里遵循指南:https://medium.com/@patnaikshekhar/initialize-your-aks-nodes-with-daemonsets-679fa81fd20e

我的守护进程:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: installer
  namespace: node-installer
spec:
  selector:
    matchLabels:
      job: installer
  template:
    metadata:
      labels:
        job: installer
    spec:
      hostPID: true
      restartPolicy: Always
      containers:
      - image: patnaikshekhar/node-installer:1.3
        name: installer
        securityContext:
          privileged: true
        volumeMounts:
        - name: install-script
          mountPath: /tmp
        - name: host-mount
          mountPath: /host
      volumes:
      - name: install-script
        configMap:
          name: sample-installer-config
      - name: host-mount
        hostPath:
          path: /tmp/install

这是我的 configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: sample-installer-config
  namespace: node-installer
data:
  install.sh: |
    #!/bin/bash
    # Update and install packages
    apt-get update
    apt-get install nfs-kernel-server -y

让 pod 构建并完成 (x3),当我检查它们的日志时,只有第一个 pod 的日志显示节点上安装的包。其余的 pod 根本没有日志。有没有办法可靠地做到这一点?

【问题讨论】:

    标签: azure kubernetes configmap daemonset


    【解决方案1】:

    实现这一点的方法是使用 daemonset 和 configmap,使用特权的 pod 执行策略和主机路径挂载。这样容器就可以将所需的包安装到主机节点上,而守护进程会将配置应用到集群上的所有新节点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-12
      • 1970-01-01
      • 2021-10-03
      • 1970-01-01
      • 1970-01-01
      • 2019-09-03
      相关资源
      最近更新 更多