Last active
April 15, 2019 15:02
-
-
Save learntheropes/1e67e550101c3e1a5cf4432c42665f17 to your computer and use it in GitHub Desktop.
Influxdb Kubernetes locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update && sudo apt-get install -y apt-transport-https | |
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - | |
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - | |
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib" | |
sudo apt update | |
sudo apt install virtualbox-6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update && sudo apt-get install -y apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list | |
sudo apt-get update | |
sudo apt-get install -y kubectl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.0.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minikube start | |
# with settings: minikube start --cpus 4 --memory 8192 | |
kubectl api-versions | |
kubectl cluster-info | |
kubectl get nodes | |
kubectl describe node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh | |
chmod 700 get_helm.sh | |
./get_helm.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filename: clusterrole.yalm | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
annotations: | |
rbac.authorization.kubernetes.io/autoupdate: "true" | |
labels: | |
kubernetes.io/bootstrapping: rbac-defaults | |
name: cluster-admin | |
rules: | |
- apiGroups: | |
- '*' | |
resources: | |
- '*' | |
verbs: | |
- '*' | |
- nonResourceURLs: | |
- '*' | |
verbs: | |
- '*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl create -f clusterrole.yaml | |
kubectl create serviceaccount -n kube-system tiller | |
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | |
helm init --service-account tiller | |
helm init --upgrade --service-account tiller | |
kubectl --namespace kube-system get pods | grep tiller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm install --name my-release \ | |
--set persistence.enabled=true,persistence.size=5Gi \ | |
stable/influxdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## influxdb image version | |
## ref: https://hub.docker.com/r/library/influxdb/tags/ | |
image: | |
repo: "influxdb" | |
tag: "1.7.3-alpine" | |
pullPolicy: IfNotPresent | |
## Specify a service type | |
## NodePort is default | |
## ref: http://kubernetes.io/docs/user-guide/services/ | |
## | |
service: | |
## Add annotations to service | |
# annotations: {} | |
type: ClusterIP | |
## Add IP Cluster | |
# clusterIP: "" | |
## Add external IPs that route to one or more cluster nodes | |
# externalIPs: [] | |
## Specify LoadBalancer IP (only allow on some cloud provider) | |
# loadBalancerIP: "" | |
## Allow source IPs to access on service (if empty, any access allow) | |
# loadBalancerSourceRanges: [] | |
## Persist data to a persistent volume | |
## | |
persistence: | |
enabled: false | |
## If true will use an existing PVC instead of creating one | |
# useExisting: false | |
## Name of existing PVC to be used in the influx deployment | |
# name: | |
## influxdb data Persistent Volume Storage Class | |
## If defined, storageClassName: <storageClass> | |
## If set to "-", storageClassName: "", which disables dynamic provisioning | |
## If undefined (the default) or set to null, no storageClassName spec is | |
## set, choosing the default provisioner. (gp2 on AWS, standard on | |
## GKE, AWS & OpenStack) | |
## | |
# storageClass: "-" | |
accessMode: ReadWriteOnce | |
size: 8Gi | |
## Create default user through Kubernetes job | |
## Defaults indicated below | |
## | |
setDefaultUser: | |
enabled: false | |
## Image of the container used for job | |
## Default: appropriate/curl:latest | |
## | |
image: appropriate/curl:latest | |
## Deadline for job so it does not retry forever. | |
## Default: activeDeadline: 300 | |
## | |
activeDeadline: 300 | |
## Restart policy for job | |
## Default: OnFailure | |
restartPolicy: OnFailure | |
user: | |
## The user name | |
## Default: "admin" | |
username: "admin" | |
## User password | |
## single quotes must be escaped (\') | |
## Default: (Randomly generated 10 characters of AlphaNum) | |
# password: | |
## User privileges | |
## Default: "WITH ALL PRIVILEGES" | |
privileges: "WITH ALL PRIVILEGES" | |
## Configure resource requests and limits | |
## ref: http://kubernetes.io/docs/user-guide/compute-resources/ | |
resources: | |
requests: | |
memory: 256Mi | |
cpu: 0.1 | |
limits: | |
memory: 16Gi | |
cpu: 8 | |
ingress: | |
enabled: false | |
tls: false | |
# secretName: my-tls-cert # only needed if tls above is true | |
hostname: influxdb.foobar.com | |
annotations: | |
# kubernetes.io/ingress.class: "nginx" | |
# kubernetes.io/tls-acme: "true" | |
## Use an alternate scheduler, e.g. "stork". | |
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ | |
## | |
# schedulerName: | |
## Node labels for pod assignment | |
## Ref: https://kubernetes.io/docs/user-guide/node-selection/ | |
## | |
nodeSelector: {} | |
## Affinity for pod assignment | |
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity | |
## | |
affinity: {} | |
## Tolerations for pod assignment | |
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | |
## | |
tolerations: [] | |
# - key: "key" | |
# operator: "Equal|Exists" | |
# value: "value" | |
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" | |
## The InfluxDB image uses several environment variables to automatically | |
## configure certain parts of the server. | |
## Ref: https://hub.docker.com/_/influxdb/ | |
env: | |
# - name: INFLUXDB_DB | |
# value: "demo" | |
## Change InfluxDB configuration parameters below: | |
## Defaults are indicated | |
## ref: https://docs.influxdata.com/influxdb/v1.1/administration/config/ | |
config: | |
reporting_disabled: false | |
storage_directory: /var/lib/influxdb | |
rpc: | |
enabled: true | |
bind_address: 8088 | |
meta: | |
retention_autocreate: true | |
logging_enabled: true | |
data: | |
query_log_enabled: true | |
cache_max_memory_size: 1073741824 | |
cache_snapshot_memory_size: 26214400 | |
cache_snapshot_write_cold_duration: 10m0s | |
compact_full_write_cold_duration: 4h0m0s | |
max_series_per_database: 1000000 | |
max_values_per_tag: 100000 | |
trace_logging_enabled: false | |
coordinator: | |
write_timeout: 10s | |
max_concurrent_queries: 0 | |
query_timeout: 0s | |
log_queries_after: 0s | |
max_select_point: 0 | |
max_select_series: 0 | |
max_select_buckets: 0 | |
retention: | |
enabled: true | |
check_interval: 30m0s | |
shard_precreation: | |
enabled: true | |
check_interval: 10m0s | |
advance_period: 30m0s | |
admin: | |
enabled: false | |
bind_address: 8083 | |
https_enabled: false | |
https_certificate: /etc/ssl/influxdb.pem | |
monitor: | |
store_enabled: true | |
store_database: _internal | |
store_interval: 10s | |
subscriber: | |
enabled: true | |
http_timeout: 30s | |
insecure_skip_verify: false | |
ca_certs: "" | |
write_concurrency: 40 | |
write_buffer_size: 1000 | |
http: | |
enabled: true | |
bind_address: 8086 | |
auth_enabled: false | |
log_enabled: true | |
write_tracing: false | |
pprof_enabled: true | |
https_enabled: false | |
https_certificate: /etc/ssl/influxdb.pem | |
https_private_key: "" | |
max_row_limit: 10000 | |
max_connection_limit: 0 | |
shared_secret: "beetlejuicebeetlejuicebeetlejuice" | |
realm: InfluxDB | |
unix_socket_enabled: false | |
bind_socket: /var/run/influxdb.sock | |
graphite: | |
enabled: false | |
bind_address: 2003 | |
database: graphite | |
retention_policy: autogen | |
protocol: tcp | |
batch_size: 5000 | |
batch_pending: 10 | |
batch_timeout: 1s | |
consistency_level: one | |
separator: . | |
udp_read_buffer: 0 | |
# Uncomment to define graphite templates | |
# templates: | |
# - "graphite.metric.*.*.* measurement.run" | |
collectd: | |
enabled: false | |
bind_address: 25826 | |
database: collectd | |
retention_policy: autogen | |
batch_size: 5000 | |
batch_pending: 10 | |
batch_timeout: 10s | |
read_buffer: 0 | |
typesdb: /usr/share/collectd/types.db | |
security_level: none | |
auth_file: /etc/collectd/auth_file | |
opentsdb: | |
enabled: false | |
bind_address: 4242 | |
database: opentsdb | |
retention_policy: autogen | |
consistency_level: one | |
tls_enabled: false | |
certificate: /etc/ssl/influxdb.pem | |
batch_size: 1000 | |
batch_pending: 5 | |
batch_timeout: 1s | |
log_point_errors: true | |
udp: | |
enabled: false | |
bind_address: 8089 | |
database: udp | |
retention_policy: autogen | |
batch_size: 5000 | |
batch_pending: 10 | |
read_buffer: 0 | |
batch_timeout: 1s | |
precision: "ns" | |
continuous_queries: | |
log_enabled: true | |
enabled: true | |
run_interval: 1s | |
logging: | |
format: auto | |
level: info | |
supress_logo: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
get-started-kubernetes
influxdb helm chart
influxdb
storing-and-processing-billions-of-cryptocurrency-market-data-using-influxdb
influxdb-grafana-kubernetes