我正在尝试在我的 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 根本没有日志。有没有办法可靠地做到这一点?