blob: bd4b7a772f43515d5d20232dfab494826019ac28 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: camel-quarkus-examples-mariadb-database-deployment
labels:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
template:
metadata:
labels:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
spec:
containers:
- name: mariadb-database
image: docker.io/mariadb:10.11
ports:
- containerPort: 3306
env:
- name: MARIADB_USER
valueFrom:
secretKeyRef:
name: mariadb-secret
key: db-user
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: mariadb-secret
key: db-password
- name: MARIADB_DATABASE
value: my-db
- name: MARIADB_RANDOM_ROOT_PASSWORD
value: generate
volumeMounts:
# The /var/lib/mysql folder is where the actual database content is stored
- name: mariadb-database-data-volume
mountPath: /var/lib/mysql
volumes:
# Explicitly create an empty dir volume in order to ensure read/write access needed to store database files
- name: mariadb-database-data-volume
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
name: mariadb-database
spec:
ports:
- name: mariadb
port: 3306
targetPort: 3306
selector:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
type: ClusterIP
---
apiVersion: v1
kind: Secret
metadata:
labels:
app.kubernetes.io/name: camel-quarkus-examples-mariadb-database
app.kubernetes.io/version: 3.8.1
name: mariadb-secret
type: Opaque
data:
# mariadb
db-user: bWFyaWFkYg==
# s3cr3t
db-password: czNjcjN0
---
apiVersion: batch/v1
kind: Job
metadata:
name: camel-quarkus-examples-jpa-idempotent-repository-flyway-init
spec:
completionMode: NonIndexed
template:
metadata:
labels:
app.kubernetes.io/name: camel-quarkus-examples-jpa-idempotent-repository-flyway-init
app.kubernetes.io/version: 3.8.1
spec:
containers:
- env:
- name: DB_HOSTNAME
value: mariadb-database
- name: JAVA_APP_JAR
value: /deployments/quarkus-run.jar
- name: QUARKUS_INIT_AND_EXIT
value: "true"
- name: QUARKUS_FLYWAY_ENABLED
value: "true"
image: camel-quarkus-examples-jpa-idempotent-repository:3.7.0-SNAPSHOT
name: camel-quarkus-examples-jpa-idempotent-repository-flyway-init
restartPolicy: OnFailure
serviceAccountName: camel-quarkus-examples-jpa-idempotent-repository