Open neuromantik33 opened 3 years ago
Just for note, I've been using kustomize
for some specific patches and running
$ kustomize build dev/kube-prometheus | kpt live apply --reconcile-timeout=2m --output table
seems to work fine :)
Thank you very much for providing exact steps, your yml files and command output. Very very cool. Glad you got a work around for now, I will see if we can find someone to take a look but since you can keep making progress we'll set it up as P1/P2 (instead of P0).
@seans3 can you take a look since you own this area?
@neuromantik33 Can you please show the beginning of the ConfigMapList config yaml? What seems odd in your output is that the "Name" (which is a mandatory field) seems missing (at least kpt thinks its missing).
The raw yaml which is having issues is located here. However it does seem to have a name
metadata:
labels:
app.kubernetes.io/component: grafana
app.kubernetes.io/name: grafana
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 7.3.7
name: grafana-dashboard-workload-total
namespace: monitoring
kind: ConfigMapList
@neuromantik33 We intend to figure out why ConfigMapList
is having issues in kpt. Here is more context:
ConfigMapList
and other List
resources are never stored in the cluster. So when we try to apply a List
, we get the error (empty name). The cluster does not perform transactions of multiple resources, and these List
-types of resources are usually used to return a group of objects. Other tools handle these List
transparently by applying the resources within the List
one-by-one. kpt
needs to add this List
handling functionality.ConfigMapList
to another list of resources (without ConfigMapList
) separated by ---
can currently be used as a workaround.ConfigMapList
) would also be a workaround.Leaving open at P2 until we correctly add List
handling.
I thought we had handling to unwrap lists when we read files/streams. But looking at it now, the functionality for unwrapping lists in the kyaml library is not sufficient to handle this situation: https://github.com/kubernetes-sigs/kustomize/blob/c9e7f627fe8f75bc60ea76c4974e8d7eada752ec/kyaml/kio/byteio_reader.go#L176
When trying to create a kpt package of kube-prometheus, for a GKE cluster in 1.18.x
I seems that the manifests:
grafana-dashboardDefinitions.yaml
prometheus-roleBindingSpecificNamespaces.yaml
prometheus-roleSpecificNamespaces.yaml
are in fact list types, actually
ConfigMapList
,RoleBindingList
andRoleList
respectively. And when trying to perform akpt live apply
, the following message gets printed out:Of course I'm able to apply the manifests manually using
kubectl
, so I did and it works, but I would prefer usingkpt
.Here is a more detailed example
Of course according to the official API docs
However since
kubectl
seems to support applying such manifests, is there a way forkpt
do to the same?Thanks in advance