在k8s集群中使用helm安装influxdb


使用helm安装influxdb的前提

使用helm安装,我们必须有一个k8s集群,因为helm是把influxdb安装在k8s集群上的。


搜索influxdb

helm search influxdb

搜索结果:

NAME                    CHART VERSION   APP VERSION     DESCRIPTION                                                 
stable/influxdb         0.8.2                           Scalable datastore for metrics, events, and real-time ana...
stable/kapacitor        0.5.0                           InfluxDB's native data processing engine. It can process ...

helm安装influxdb

我们这里安装稳定版本stable/influxdb

helm install stable/influxdb -n influxdb

名字为influxdb


安装成功后

安装成功后,出现如下提示:

NAME:   influxdb
LAST DEPLOYED: Fri Apr  3 08:46:20 2020
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME               DATA  AGE
influxdb-influxdb  1     0s

==> v1/Pod(related)
NAME                                READY  STATUS             RESTARTS  AGE
influxdb-influxdb-779bc8b7c8-hvljk  0/1    ContainerCreating  0         0s

==> v1/Service
NAME               TYPE       CLUSTER-IP   EXTERNAL-IP  PORT(S)   AGE
influxdb-influxdb  ClusterIP  10.1.89.241  <none>       8086/TCP  0s

==> v1beta1/Deployment
NAME               READY  UP-TO-DATE  AVAILABLE  AGE
influxdb-influxdb  0/1    1           0          0s


NOTES:
InfluxDB can be accessed via port 8086 on the following DNS name from within your cluster:

- http://influxdb-influxdb.default:8086

You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following:

- kubectl port-forward --namespace default $(kubectl get pods --namespace default -l app=influxdb-influxdb -o jsonpath='{ .items[0].metadata.name }') 8086:8086

You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following:

- kubectl exec -i -t --namespace default $(kubectl get pods --namespace default -l app=influxdb-influxdb -o jsonpath='{.items[0].metadata.name}') /bin/sh

To tail the logs for the InfluxDB pod run the following:

- kubectl logs -f --namespace default $(kubectl get pods --namespace default -l app=influxdb-influxdb -o jsonpath='{ .items[0].metadata.name }')

如果你的屏幕中,显示这么一长串内容,就代表安装成功了。这些信息代表什么意思呢?我们一下说不清楚,我相信说清楚大家也没兴趣看,因为,这些知识和helm有关,需要详细了解helm原理的同学,可以移步<<helm教程>>看一下