-
Notifications
You must be signed in to change notification settings - Fork 3
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
add mariadb image #285
Merged
Merged
add mariadb image #285
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM ubuntu | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && \ | ||
apt-get install -y \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
software-properties-common | ||
Comment on lines
+5
to
+10
Check failure Code scanning / Trivy 'apt-get' missing '--no-install-recommends' High
Artifact: tfgrid3/monitored_mariadb/Dockerfile
Type: dockerfile Vulnerability DS029 Severity: HIGH Message: '--no-install-recommends' flag is missed: 'apt update && apt-get install -y apt-transport-https ca-certificates curl software-properties-common' Link: DS029 |
||
|
||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - &&\ | ||
add-apt-repository \ | ||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) \ | ||
stable" | ||
|
||
RUN apt-get update && apt-get install -y docker-ce | ||
Check failure Code scanning / Trivy 'apt-get' missing '--no-install-recommends' High
Artifact: tfgrid3/monitored_mariadb/Dockerfile
Type: dockerfile Vulnerability DS029 Severity: HIGH Message: '--no-install-recommends' flag is missed: 'apt-get update && apt-get install -y docker-ce' Link: DS029 |
||
|
||
RUN apt install -y wget openssh-server | ||
|
||
COPY . . | ||
|
||
RUN wget -O /sbin/zinit https://github.com/threefoldtech/zinit/releases/download/v0.2.5/zinit && \ | ||
chmod +x /sbin/zinit | ||
|
||
|
||
ENTRYPOINT [ "/sbin/zinit", "init" ] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
services: | ||
mariadb-master: | ||
image: mariadb:latest | ||
container_name: mariadb-master | ||
environment: | ||
MYSQL_ROOT_PASSWORD: rootpassword | ||
MYSQL_DATABASE: mydb | ||
MYSQL_USER: user | ||
MYSQL_PASSWORD: password | ||
volumes: | ||
- master-data:/var/lib/mysql | ||
networks: | ||
- monitoring | ||
|
||
mariadb-slave: | ||
image: mariadb:latest | ||
container_name: mariadb-slave | ||
environment: | ||
MYSQL_ROOT_PASSWORD: rootpassword | ||
MYSQL_REPLICATION_MODE: slave | ||
MYSQL_MASTER_HOST: mariadb-master | ||
MYSQL_MASTER_USER: root | ||
MYSQL_MASTER_PASSWORD: password | ||
MYSQL_DATABASE: mydb | ||
depends_on: | ||
- mariadb-master | ||
networks: | ||
- monitoring | ||
|
||
mariadb_exporter: | ||
image: prom/mysqld-exporter:latest | ||
container_name: mariadb_exporter | ||
command: | ||
- "--mysqld.username=user:password" | ||
- "--mysqld.address=mariadb-master:3306" | ||
ports: | ||
- "9104:9104" | ||
depends_on: | ||
- mariadb-master | ||
|
||
prometheus: | ||
image: prom/prometheus | ||
container_name: prometheus | ||
command: | ||
- "--config.file=/etc/prometheus/prometheus.yml" | ||
ports: | ||
- 9090:9090 | ||
restart: unless-stopped | ||
volumes: | ||
- ./prometheus:/etc/prometheus | ||
|
||
grafana: | ||
image: grafana/grafana | ||
container_name: grafana | ||
ports: | ||
- 3000:3000 | ||
restart: unless-stopped | ||
environment: | ||
- GF_SECURITY_ADMIN_USER=admin | ||
- GF_SECURITY_ADMIN_PASSWORD=grafana | ||
volumes: | ||
- ./provisioning:/etc/grafana/provisioning | ||
- ./provisioning/dashboards:/var/lib/grafana/dashboards | ||
|
||
volumes: | ||
master-data: | ||
|
||
networks: | ||
monitoring: | ||
driver: bridge |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exec: dockerd -D | ||
test: docker ps |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exec: docker compose -p monitored-mariadb up | ||
oneshot: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exec: /usr/sbin/sshd -D |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
exec: | | ||
bash -c ' | ||
if [ ! -z "$SSH_KEY" ]; then | ||
mkdir -p /var/run/sshd | ||
mkdir -p /root/.ssh | ||
touch /root/.ssh/authorized_keys | ||
|
||
chmod 700 /root/.ssh | ||
chmod 600 /root/.ssh/authorized_keys | ||
|
||
echo "$SSH_KEY" >> /root/.ssh/authorized_keys | ||
fi | ||
' | ||
oneshot: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
global: | ||
scrape_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: 'mariadb-exporter' | ||
static_configs: | ||
- targets: ['mariadb_exporter:9104'] |
8 changes: 8 additions & 0 deletions
8
tfgrid3/monitored_mariadb/provisioning/dashboards/default.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: 1 | ||
|
||
providers: | ||
- name: Default # A uniquely identifiable name for the provider | ||
folder: Services # The folder where to place the dashboards | ||
type: file | ||
options: | ||
path: /var/lib/grafana/dashboards |
52 changes: 52 additions & 0 deletions
52
tfgrid3/monitored_mariadb/provisioning/dashboards/simple-dashboard.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"annotations": { | ||
"list": [] | ||
}, | ||
"editable": true, | ||
"gnetId": null, | ||
"graphTooltip": 0, | ||
"id": null, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"datasource": "Prometheus", | ||
"fieldConfig": { | ||
"defaults": {}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 9, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"targets": [ | ||
{ | ||
"expr": "up", | ||
"interval": "", | ||
"legendFormat": "{{instance}}", | ||
"refId": "A" | ||
} | ||
], | ||
"title": "Service Status", | ||
"type": "graph" | ||
} | ||
], | ||
"refresh": "5s", | ||
"schemaVersion": 30, | ||
"style": "dark", | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-5m", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "Simple Dashboard", | ||
"uid": "simple-dashboard", | ||
"version": 1 | ||
} |
9 changes: 9 additions & 0 deletions
9
tfgrid3/monitored_mariadb/provisioning/datasources/default.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
url: http://prometheus:9090 | ||
isDefault: true | ||
access: proxy | ||
editable: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / Trivy
Image user should not be 'root' High