init commit

This commit is contained in:
Danyliuk
2022-10-29 22:46:44 +03:00
commit 43fd54cd9b
12 changed files with 357 additions and 0 deletions

11
k8s/backend-matomo.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: matomo-playground
spec:
type: ClusterIP
selector:
app: matomo-playground
ports:
- protocol: TCP
port: 8081

11
k8s/backend-mysql.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: mysql-playground
spec:
type: ClusterIP
selector:
app: matomo-playground
ports:
- protocol: TCP
port: 3306

View File

@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: matomo-playground
spec:
replicas: 1
selector:
matchLabels:
app: matomo
template:
metadata:
labels:
app: matomo
spec:
containers:
- name: matomo
image: matomo:4.12.0-apache
ports:
- containerPort: 8081

38
k8s/deployment-mysql.yaml Normal file
View File

@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-playground
labels:
app: matomo-playground
spec:
selector:
matchLabels:
app: matomo-playground
tier: mysql-playground
strategy:
type: Recreate
template:
metadata:
labels:
app: matomo-playground
tier: mysql-playground
spec:
containers:
- image: mysql:8.0.31
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: oleksii-mysql-pv-claim

25
k8s/ingress-matomo.yaml Normal file
View File

@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: oleksii-matomo
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
spec:
rules:
- host: oleksii-matomo.k-space.ee
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: matomo-playground
port:
number: 8081
tls:
- hosts:
- "*.k-space.ee"

25
k8s/ingress-mysql.yaml Normal file
View File

@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: oleksii-mysql
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
spec:
rules:
- host: oleksii-mysql.k-space.ee
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: matomo-playground
port:
number: 3306
tls:
- hosts:
- "*.k-space.ee"

4
k8s/kustomization.yaml Normal file
View File

@@ -0,0 +1,4 @@
secretGenerator:
- name: mysql-pass
literals:
- password=helloworld

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: oleksii-mysql-pv-claim
labels:
app: matomo-playground
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi