In kubernetes 1.29.x cluster. Fisrt make sure the namespaces contains configmap:
➜ migration kubectl get configmaps -n reddwarf-cache
NAME DATA AGE
cruise-redis-configuration 3 2y334d
cruise-redis-health 6 2y334d
cruise-redis-scripts 2 2y334d
kube-root-ca.crt 1 2y334d
reddwarf-redis-configuration 3 451d
reddwarf-redis-health 6 451d
reddwarf-redis-scripts 2 451d
When I tried to use this command to get the kubernets configmap:
➜ migration kubectl get configmaps -o yaml -n reddwarf-cache- > reddwarf-cache-configmap.yaml
➜ migration cat reddwarf-cache-configmap.yaml
apiVersion: v1
items: []
kind: List
metadata:
resourceVersion: ""
selfLink: ""
the configmap is null, I am sure I can access the config map, why could not get the configmap yaml config from the kubernetes cluster?I also tried:
kubectl get cm -o yaml -n reddwarf-cache- > reddwarf-cache-configmap.yaml
-n reddwarf-cache-
(note the trailing hypen). Is that a typo?