简体   繁体   English

读/写模式下configmap中的大三角帆安装卷(0666)

[英]spinnaker mount volume from configmap in read/write mode (0666)

Spinnaker mounts volumes like this: 三角帆安装如下卷:

apiVersion: v1
kind: Pod
metadata:
  ...
spec:
  containers:
    ...
  volumes:
  - configMap:
      defaultMode: 420
      items:
      - key: config
        path: config
      name: kubectl-k8s-integration
    name: "1551221025832"
  - ...

I need the config file to be writeble by everyone so that I can use kubectl config use-context in the container, ie I need defaultMode to be 666 instead of 420. There doesn't seem to be place in the Spinnaker GUI to set this when defining volumes. 我需要每个人都可写的配置文件,以便可以在容器中使用kubectl config use-context ,即我需要将defaultMode为666而不是defaultMode GUI中似乎没有放置此文件的位置定义体积时。 What am I missing? 我想念什么?

Based on https://github.com/spinnaker/spinnaker/issues/2118 , it is not possible. 基于https://github.com/spinnaker/spinnaker/issues/2118 ,这是不可能的。

My workaround: I configure spinnaker to mount the configmap volume to a different filename, and added code to the container that automatically copies to the expected folder; 我的解决方法:我将大三角帆配置为将configmap卷挂载到其他文件名,并向容器中添加了代码,该容器会自动复制到期望的文件夹中; the copy has write-access. 该副本具有写访问权限。

Eg say my configmap has a key named "config", and I was previously mounting the configmap as /home/user/.kube , so .kube/config was the file with permission 420 instead of 666. Well I now mount it as /home/user/root.kube , and the container does the equivalent of cp -r /home/user/root.kube /home/user/.kube when it starts. 例如,说我的configmap有一个名为“ config”的键,我以前将configmap挂载为/home/user/.kube ,因此.kube / config是具有权限420而不是666的文件。现在我将其挂载为/home/user/root.kube ,并且容器在启动时相当于cp -r /home/user/root.kube /home/user/.kube Now /home/user/.kube/config is writable by user. 现在,/home/user/.kube/config是用户可写的。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM