简体   繁体   English

如何为 VMWare 的 fluentd 操作员安装 ConfigMap 卷?

[英]How do I mount a ConfigMap volume for VMWare's fluentd operator?

I am trying to mount a Kubernetes configmap for VMWare's Fluentd operator [ 1 ].我试图安装一个Kubernetes configmap为VMWare的Fluentd运营商[ 1 ]。 I've checked the documentation and the helm chart indicates that you have to specify an additional volume as a parameter called fluentd.extraVolumeMounts我检查了文档,舵图表明您必须指定一个额外的卷作为名为fluentd.extraVolumeMounts的参数

The helm chart I'm using to install the operator is below :我用来安装操作员的舵图如下:


#!/bin/sh
# helmenv set to helm3

CHART_URL='https://github.com/vmware/kube-fluentd-operator/releases/download/v1.12.0/log-router-0.3.3.tgz'

# Set environment variables.
REGION='us-east-1'
CLUSTER='dev'
ENV='dev'
IMAGE_TAG='v1.12.0'

VOLUME_MOUNT="
- name: fluentd-es-templates
  mountPath: /templates"

EXTRA_VOLUME="
- name: fluentd-es-templates
  configMap:
    name: fluentd-es-templates"

# Install the fluentd operator in kube-system.
# helm install kfo ${CHART_URL} \
helm upgrade --install kfo ${CHART_URL} \
  --set meta.key=metadata \
  --set meta.values.region=${REGION} \
  --set meta.values.env=${ENV} \
  --set meta.values.cluster=${CLUSTER} \
  --set rbac.create=true \
  --set image.tag=${IMAGE_TAG} \
  --set image.repository=vmware/kube-fluentd-operator \
# --set fluentd.extraVolumeMounts=[$EXTRA_VOLUME]
# --set extraVolumes=[${EXTRA_VOLUME}]

When I un-comment the lines that set the volumes, the helm script fails.当我取消注释设置卷的行时,舵脚本失败。 My question is, how do I populate the VOLUME_MOUNT and EXTRA_VOLUME variables with the correct json or yaml?我的问题是,如何使用正确的 json 或 yaml 填充VOLUME_MOUNTEXTRA_VOLUME变量? I'm trying to do everything in one file and don't want to split things into multiple files.我试图在一个文件中做所有事情,不想将事情分成多个文件。

You can still use a values file from within the shell script via process substitution.您仍然可以通过进程替换在 shell 脚本中使用值文件。 Here is an example:下面是一个例子:

#!/usr/bin/env bash
CHART_URL='https://github.com/vmware/kube-fluentd-operator/releases/download/v1.12.0/log-router-0.3.3.tgz'

read -r -d '' values << EOF
meta:
  key: metadata
  values:
    region: "us-east-1"
    env: "dev"
    cluster: "dev"
rbac:
  create: true
image:
  repository: vmware/kube-fluentd-operator
  tag: "v1.12.0"
fluentd:
  extraVolumeMounts:
    - name: fluentd-es-templates
      mountPath: /fluentd/etc/mappings
extraVolumes:
  - name: fluentd-es-templates
    configMap:
      name: fluentd-es-templates
EOF

helm upgrade --install kfo "$CHART_URL" -f <(printf '%s' "$values")

Under the hood this creates a named pipe and passes a file descriptor such as /dev/fd/123 to the helm install command.在幕后,这会创建一个命名管道并将文件描述符(例如/dev/fd/123传递给 helm install 命令。 This feature is not available in some shells, such as dash ( /bin/sh in Debian and Ubuntu).此功能在某些 shell 中不可用,例如 dash(在 Debian 和 Ubuntu 中为/bin/sh )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用舵图在 VMWare 的 Kubernetes FluentD Operator 中将 prometheus.enabled 标志设置为 true? - How can I set the prometheus.enabled flag to true in VMWare's Kubernetes FluentD Operator using the helm chart? 在 Terraform aws_ecs_task_definition 如何在卷部分定义绑定挂载 - In Terraform aws_ecs_task_definition how do I define bind mount in the volume section 如何将 EFS 卷挂载到在 AWS ubuntu18 实例上运行的 kubernetes 集群作为持久卷? - How can I mount an EFS volume to a kubernetes cluster running on AWS ubuntu18 instances as Persistent Volume? 我可以下载AWS Volume的快照并挂载到本地计算机中并从中启动吗? - Can i download AWS Volume's Snapshot and mount in my local machine and boot from it? 如何在CLI中安装连接的EC2卷? - How to mount an attached EC2 volume in CLI? 如何在Amazon S3中按大小范围计算文件数量及其占用的卷 - How do I account the number of files and the volume they occupy by size range in amazon s3 K8S无法将AWS EBS挂载为Pod的持久卷 - K8S Unable to mount AWS EBS as a persistent volume for pod 带有挂载卷的MySQL k8s Pod在AWS上失败 - Mysql k8s Pod with mount volume on AWS failing 如何在Windows中扩展EBS卷 - How do I extend an EBS volume in Windows 如何检测EBS卷类型? - How do I detect the EBS volume type?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM