Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use kustomization.yaml file to setup kube-prometheus #659

Closed
rsoika opened this issue Aug 29, 2020 · 1 comment
Closed

Can not use kustomization.yaml file to setup kube-prometheus #659

rsoika opened this issue Aug 29, 2020 · 1 comment

Comments

@rsoika
Copy link

rsoika commented Aug 29, 2020

What happened?
I tried to use the kustomization.yaml file to setup kube-prometheus.

For that I created my own kustomization file like this one:

namespace: monitoring

bases:
- https://github.com/prometheus-operator/kube-prometheus

resources:
- ingress.yaml

patchesStrategicMerge:
- grafana-env.yaml

My goal was to add a ingress config and some custom grafana environment variables.

Starting the deplyoment with
kubectl apply --kustomize ../monitoring/

Did not work and I got the following output

...
.....
......
apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
daemonset.apps/node-exporter created
ingress.networking.k8s.io/grafana created
unable to recognize "management/monitoring/": no matches for kind "Alertmanager" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "Prometheus" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "PrometheusRule" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
unable to recognize "management/monitoring/": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"

I guess the reason for that is that - as explained in the quick-start guide - I first need to

# 1st create setup manifests..
$ kubectl apply -f manifests/setup
# wait a little bit for system monitors...
$ until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
# create main manifests....
$ kubectl apply -f manifests/

After doing this, I can of course run my kustzomize script without errors and the exptected result:

kubectl apply --kustomize ../monitoring/

So I would not say this is a bug of kube-prometheus, but I ask if there is any way to solve this kind of setup using kustzomze in a better way?

@philipgough
Copy link
Contributor

@rsoika - unfortunately there is not much this project can do to solve the issue. If you were to run kubectl apply --kustomize ../monitoring/ in a loop it will likely work once the api server has recognised the CRD's

It is a known issue in this regard, see kubernetes-sigs/kustomize#3794 for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants