2 changed files with 160 additions and 0 deletions
@ -0,0 +1,89 @@ |
|||||
|
# Deployment description |
||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: mariadb-deployment |
||||
|
namespace: infra-environment |
||||
|
labels: |
||||
|
app: mariadb-infra |
||||
|
spec: |
||||
|
strategy: |
||||
|
type: Recreate |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app: mariadb-infra |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: mariadb-infra |
||||
|
spec: |
||||
|
containers: |
||||
|
- name: mariadb |
||||
|
image: mariadb:10.7.1 |
||||
|
resources: |
||||
|
requests: |
||||
|
memory: "256Mi" |
||||
|
cpu: "100m" |
||||
|
limits: |
||||
|
memory: "512Mi" |
||||
|
cpu: "4" |
||||
|
ports: |
||||
|
- containerPort: 3306 |
||||
|
envFrom: |
||||
|
- configMapRef: |
||||
|
name: mariadb-config |
||||
|
volumeMounts: |
||||
|
- mountPath: /var/lib/mysql |
||||
|
name: mariadb-pv-infra |
||||
|
subPath: mariadb |
||||
|
volumes: |
||||
|
- name: mariadb-pv-infra |
||||
|
persistentVolumeClaim: |
||||
|
claimName: mariadb-pvc-infra |
||||
|
--- |
||||
|
# Persistent Volume Claim description |
||||
|
apiVersion: v1 |
||||
|
kind: PersistentVolumeClaim |
||||
|
metadata: |
||||
|
name: mariadb-pvc-infra |
||||
|
namespace: infra-environment |
||||
|
labels: |
||||
|
app: mariadb-infra |
||||
|
spec: |
||||
|
storageClassName: longhorn |
||||
|
accessModes: |
||||
|
- ReadWriteOnce |
||||
|
resources: |
||||
|
requests: |
||||
|
storage: 10Gi |
||||
|
--- |
||||
|
# ConfigMap description |
||||
|
apiVersion: v1 |
||||
|
kind: ConfigMap |
||||
|
metadata: |
||||
|
name: mariadb-config |
||||
|
namespace: infra-environment |
||||
|
labels: |
||||
|
app: mariadb-infra |
||||
|
data: |
||||
|
MYSQL_ROOT_PASSWORD: Semapp123456! |
||||
|
MYSQL_DATABASE: mariadb |
||||
|
MYSQL_USER: mysqluser |
||||
|
MYSQL_PASSWORD: Semapp123456! |
||||
|
--- |
||||
|
# mariadb StatefulSet Service |
||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: mariadb-infra |
||||
|
namespace: infra-environment |
||||
|
spec: |
||||
|
selector: |
||||
|
app: mariadb-infra |
||||
|
type: LoadBalancer |
||||
|
ports: |
||||
|
- port: 3306 |
||||
|
targetPort: 3306 |
||||
|
|
||||
|
--- |
||||
@ -0,0 +1,71 @@ |
|||||
|
# Deployment description |
||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: phpmyadmin-deployment |
||||
|
namespace: infra-environment |
||||
|
labels: |
||||
|
app: phpmyadmin-infra |
||||
|
spec: |
||||
|
strategy: |
||||
|
type: Recreate |
||||
|
replicas: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
app: phpmyadmin-infra |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: phpmyadmin-infra |
||||
|
spec: |
||||
|
containers: |
||||
|
- name: phpmyadmin |
||||
|
image: phpmyadmin/phpmyadmin |
||||
|
resources: |
||||
|
requests: |
||||
|
memory: "256Mi" |
||||
|
cpu: "100m" |
||||
|
limits: |
||||
|
memory: "512Mi" |
||||
|
cpu: "4" |
||||
|
ports: |
||||
|
- containerPort: 80 |
||||
|
name: phpmyadmin-http |
||||
|
protocol: TCP |
||||
|
env: |
||||
|
- name: PMA_HOST |
||||
|
value: "mariadb-infra" |
||||
|
--- |
||||
|
# phpmyadmin Service |
||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: phpmyadmin |
||||
|
namespace: infra-environment |
||||
|
spec: |
||||
|
selector: |
||||
|
app: phpmyadmin-infra |
||||
|
ports: |
||||
|
- name: phpmyadmin-http |
||||
|
port: 80 |
||||
|
targetPort: phpmyadmin-http |
||||
|
type: NodePort |
||||
|
--- |
||||
|
|
||||
|
# Ingress description |
||||
|
apiVersion: networking.k8s.io/v1beta1 |
||||
|
kind: Ingress |
||||
|
metadata: |
||||
|
name: phpmyadmin-infra-ingress |
||||
|
namespace: infra-environment |
||||
|
annotations: |
||||
|
kubernetes.io/ingress.class: "traefik" |
||||
|
spec: |
||||
|
rules: |
||||
|
- host: phpmyadmin.k3s.semapp.lan |
||||
|
http: |
||||
|
paths: |
||||
|
- path: / |
||||
|
backend: |
||||
|
serviceName: phpmyadmin |
||||
|
servicePort: 80 |
||||
Loading…
Reference in new issue