I wanted to create influx DB CI/CD pipeline using Jenkins and host it on Kubernetes

Hi Team,

I want to setup InfluxDB CI/CD and host it on kubernetes env, Can you pls share me the sample

Hi @Manjunath_V,

Just to clarify, you are looking for a way to deploy Jenkins in Kubernetes and set up a pipeline which will compile and deploy InfluxDB from source?

InfluxData does not provide any examples of that kind, but perhaps someone from the community has something they would like to share.

Hi Noahcrowley,

Can you please share me the Docker file where I can create the InfluxDB database during the docker image creation process and run the docker images on influxdb user id

Regards,

Manjunath VS

You can find Dockerfiles for version 1.7.x at the root of the 1.7 branch of the influxdb repo on GitHub, or for the 2.0 version (in Alpha) in the master branch under /docker/influxd/.

Hi Noahcrowley,

I have seen those files but I am unable to create a specific database using the init script where I need to make changes to create the database can you pls point me exact line if you can share me an example it will be great help

Thank you

Manjunath

Creating a bucket during the image creation process is not a good practice, so we don’t have any examples of that.

Can you write more about what you are trying to do? Are you looking for a way to deploy Jenkins in Kubernetes and set up a pipeline which will compile and deploy InfluxDB from source, or are you trying to do something else?

Hi Noahcrowley,

What is the best way to create database on Docker image

I am trying to automate to create the influxdb Docker image create database as part of CI/CD pipeline

Regards

Manjunath

For InfluxDB 2 you can use the CLI for first-time configuration:

$ influx setup --help
Setup instance with initial user, org, bucket

Usage:
  influx setup [flags]

Flags:
  -b, --bucket string     primary bucket name
  -f, --force             skip confirmation prompt
  -h, --help              Help for the setup command 
  -o, --org string        primary organization name
  -p, --password string   password for username
  -r, --retention int     retention period in hours, else infinite (default -1)
  -u, --username string   primary username

Global Flags:
      --host string    HTTP address of Influx (default "http://localhost:9999")
      --local          Run commands locally against the filesystem
  -t, --token string   API token to be used throughout client calls

You can run this command using docker exec, where influxdb2 is the name of your container:

$ docker exec influxdb2 influx setup [flags]