Skip to content

Commit

Permalink
Merge branch 'master' into manikowski-docker-django-07102024
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianManiek authored Oct 9, 2024
2 parents 1218e4e + 26eaeb6 commit 12cf885
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 33 deletions.
5 changes: 3 additions & 2 deletions k8s/drupal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ include ../images.Makefile
CHART_NAME := drupal
APP_ID ?= $(CHART_NAME)

TRACK ?= 10.1
TRACK ?= 10.3

MYSQL_EXPORTER_TAG ?= exporter
MARIADB_TAG ?= 11.1
APACHE_EXPORTER_TAG ?= 0.13
METRICS_EXPORTER_TAG ?= v0.11.1-gke.1

VERIFY_WAIT_TIMEOUT = 1800

SOURCE_REGISTRY ?= marketplace.gcr.io/google
IMAGE_DRUPAL ?= $(SOURCE_REGISTRY)/drupal10-php8-apache:$(TRACK)
IMAGE_MARIADB ?= $(SOURCE_REGISTRY)/mariadb10:latest
IMAGE_MARIADB ?= $(SOURCE_REGISTRY)/mariadb11:$(MARIADB_TAG)
IMAGE_APACHE_EXPORTER ?= $(SOURCE_REGISTRY)/apache-exporter0:$(APACHE_EXPORTER_TAG)
IMAGE_MYSQLD_EXPORTER ?= $(SOURCE_REGISTRY)/mysql8:$(MYSQL_EXPORTER_TAG)
IMAGE_PROMETHEUS_TO_SD ?= gke.gcr.io/prometheus-to-sd:$(METRICS_EXPORTER_TAG)
Expand Down
18 changes: 9 additions & 9 deletions k8s/drupal/chart/drupal/templates/drupal-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ spec:
name: drupal
resources:
requests:
cpu: 100m
memory: 100Mi
cpu: 300m
memory: 300Mi
env:
- name: AUTO_INSTALL
value: 'yes'
Expand All @@ -44,7 +44,7 @@ spec:
secretKeyRef:
name: {{ .Release.Name }}-drupal-secret
key: drupal-email
# A hostname of MySQL service.
# A hostname of MariaDB service.
- name: DRUPAL_DB_HOST
value: {{ .Release.Name }}-mariadb-svc
# A username used for accessing the database.
Expand Down Expand Up @@ -73,16 +73,16 @@ spec:
httpGet:
path: /
port: 80
initialDelaySeconds: 150
periodSeconds: 30
initialDelaySeconds: 300
periodSeconds: 120
timeoutSeconds: 5
successThreshold: 2
failureThreshold: 10
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 240
initialDelaySeconds: 360
- image: {{ .Values.apache.exporter.image }}
name: apache-exporter
args:
Expand All @@ -98,10 +98,10 @@ spec:
httpGet:
path: /metrics
port: 9117
initialDelaySeconds: 60
timeoutSeconds: 30
initialDelaySeconds: 120
timeoutSeconds: 60
failureThreshold: 10
periodSeconds: 10
periodSeconds: 60
{{ if .Values.metrics.exporter.enabled }}
- name: prometheus-to-sd
image: {{ .Values.metrics.image }}
Expand Down
35 changes: 19 additions & 16 deletions k8s/drupal/chart/drupal/templates/mariadb-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ spec:
memory: 100Mi
env:
# A password for root superuser.
- name: MYSQL_ROOT_PASSWORD
- name: MARIADB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mariadb-secret
key: root-password
# A database name to be created at startup.
- name: MYSQL_DATABASE
- name: MARIADB_DATABASE
value: drupal
# A new user to be created at startup.
- name: MYSQL_USER
- name: MARIADB_USER
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mariadb-secret
key: drupal-user
# A password of the new user created at startup.
- name: MYSQL_PASSWORD
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mariadb-secret
Expand All @@ -51,29 +51,32 @@ spec:
containerPort: 3306
volumeMounts:
- name: {{ .Release.Name }}-mariadb-pvc
mountPath: /var/lib/mysql
mountPath: /var/lib/mariadb
subPath: data
- name: mariadb-config
mountPath: /docker-entrypoint-initdb.d
readOnly: true
readinessProbe:
exec:
command: ["sh", "-c", "exec mysqladmin status -uroot -p$MYSQL_ROOT_PASSWORD"]
initialDelaySeconds: 15
livenessProbe:
exec:
command: ["sh", "-c", "exec mysqladmin status -uroot -p$MYSQL_ROOT_PASSWORD"]
initialDelaySeconds: 120
tcpSocket:
port: mariadb
initialDelaySeconds: 10
timeoutSeconds: 5
readinessProbe:
tcpSocket:
port: mariadb
initialDelaySeconds: 5
timeoutSeconds: 2
- image: {{ .Values.db.exporter.image }}
args:
- "--mysqld.address=127.0.0.1:3306"
- "--mysqld.username={{ .Values.db.exporter.user }}"
name: mysqld-exporter
env:
- name: MYSQLD_EXPORTER_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mysqld-exporter-secret
key: mysqld-exporter-pass
- name: DATA_SOURCE_NAME
value: {{ .Values.db.exporter.user }}:$(MYSQLD_EXPORTER_PASSWORD)@(127.0.0.1:3306)/
ports:
- name: exporter
containerPort: 9104
Expand All @@ -85,10 +88,10 @@ spec:
httpGet:
path: /metrics
port: 9104
initialDelaySeconds: 60
initialDelaySeconds: 240
timeoutSeconds: 30
failureThreshold: 10
periodSeconds: 10
periodSeconds: 120
{{ if .Values.metrics.exporter.enabled }}
- name: prometheus-to-sd
image: {{ .Values.metrics.image }}
Expand Down
8 changes: 4 additions & 4 deletions k8s/drupal/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ x-google-marketplace:
resources:
- replicas: 1
requests:
cpu: 100m
memory: 100Mi
cpu: 300m
memory: 300Mi
- replicas: 1
requests:
cpu: 100m
memory: 100Mi
cpu: 300m
memory: 300Mi

images:
'':
Expand Down
4 changes: 2 additions & 2 deletions k8s/influxdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ APP_ID ?= $(CHART_NAME)

TRACK ?= 2.7

METRICS_EXPORTER_TAG ?= v0.5.1
METRICS_EXPORTER_TAG ?= v0.11.1-gke.1

SOURCE_REGISTRY ?= marketplace.gcr.io/google
IMAGE_INFLUXDB ?= $(SOURCE_REGISTRY)/influxdb2:$(TRACK)
IMAGE_PROMETHEUS_TO_SD ?= k8s.gcr.io/prometheus-to-sd:$(METRICS_EXPORTER_TAG)
IMAGE_PROMETHEUS_TO_SD ?= gke.gcr.io/prometheus-to-sd:$(METRICS_EXPORTER_TAG)


# Main image
Expand Down

0 comments on commit 12cf885

Please sign in to comment.