'Kubernetes pod created dynamically from parent pod using go-client does not have access to configmap [closed]
I am facing the problem with combination of Kubernetes and go client. The main program in namespace investigate is going to create child pod under namespace signer using go client. The child pod expects to mount configmap visible in namespace signer. The creation failed with an error:
Warning FailedMount 25s (x3 over 27s) kubelet MountVolume.SetUp failed for volume "keyconfig" : object "signer"/"investigate-go-configmap-keyconf" not registered
Warning FailedMount 25s (x3 over 27s) kubelet MountVolume.SetUp failed for volume "kube-api-access-xhstz" : object "signer"/"kube-root-ca.crt" not registered
The configuration start working if I add pod debug manually to signer namespace leveraging from configmap as well. Then the dynamic pods are capable to mount the configmap successfully. The only item distinguishes both configuration is debug pod with configuration as below:
apiVersion: v1
kind: Pod
metadata:
name: debug
namespace: signer
spec:
serviceAccountName: signer
containers:
- name: debug
image: alpine:3.14.0
imagePullPolicy: IfNotPresent
volumeMounts:
- name: config-volume
mountPath: /etc/config
command:
- sh
- -c
- 'echo "Done"'
volumes:
- name: config-volume
configMap:
name: investigate-go-configmap-keyconf
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
