kubernetes-app
kubernetes-app copied to clipboard
helm chart
Hello,
It would be awesome if one could just helm install it, eh? ;)
@renich grafana chart is already in kubernetes stable/grafana
But seem this application need some special config to access Kubernetes API.
Yes. Any idea of what to do? I'm kind of stuck there.
@renich there currently isn't support for templating this kind of deployment. The configs are stored inside a SQL database. Configuration is done using the Grafana UI or an api call to grafana. Grafana 5.0 has static datasources that could be installed with helm. Although I think it may get very messy since the configs for the kubernetes datasource are somewhat obfuscated from the user.
http://docs.grafana.org/administration/provisioning/#example-datasource-config-file
Your best bet would be to configure the datasource and get it working using the UI. Then output the json using the grafana api /api/datasources/:id
The static yaml file for this app will be something like this:
# config file version
apiVersion: 1
datasources:
# <string, required> name of the datasource. Required
- name: example_kube
# <string, required> datasource type. Required
type: grafana-kubernetes-datasource
# <string, required> access mode. direct or proxy. Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://localhost:443
# <string> database password, if used
password: ""
# <string> database user, if used
user: ""
# <string> database name, if used
database: ""
# <bool> enable/disable basic auth
basicAuth: false
# <string> basic auth username
basicAuthUser: ""
# <string> basic auth password
basicAuthPassword: ""
# <bool> enable/disable with credentials headers
withCredentials: true
# <bool> mark as default datasource. Max one per org
isDefault: false
# <map> fields that will be converted to json and stored in json_data
jsonData:
ds: example_prometheus
keepCookies: []
tlsAuth: true
tlsAuthWithCACert: true
secureJsonData:
tlsCACert: "..."
tlsClientCert: "..."
tlsClientKey: "..."
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false
Maybe I'm wrong but this application seem don't support "inCluster" discovery.
@thuandt By that do you mean the application will automatically configure the cluster if the Grafana instance is running in the cluster?
@jschill Yes. By default, if granfana run inside k8s cluster, we already have cert
and token
to access API server.
@thuandt the issue is, the plugin code related to adding a Kubernetes cluster is executed on the front end. So we can not take advantage of the inCluster configuration.
Just an FYI: I added the kube datasource by running kubectl as a second container in the same pod as grafana. Just run kubectl proxy --port 8888
and it will handle the token stuff. Then you can just add http://localhost:8888
as the API location. Makes it very simple.
I'm a bit confused. Is there any way of automatically installing this plugin within a kubernetes deploy?
For extra clarity in @Timbus suggestion, the last argument should be --port
kubectl proxy --port 8888
Works good for me too
Does the kubectl proxy
solution require you to be running that proxy at all times, or just for the initial configuration?