-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloghme-db.yaml
More file actions
74 lines (74 loc) · 2.82 KB
/
loghme-db.yaml
File metadata and controls
74 lines (74 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
apiVersion: v1
kind: PersistentVolumeClaim # Create a PersistentVolumeClaim to request a PersistentVolume storage
metadata: # Claim name and labels
name: mysql-pv-claim
labels:
app: loghme-mysql
spec: # Access mode and resource limits
storageClassName: manual # Request a certain storage class
accessModes:
- ReadWriteOnce # ReadWriteOnce means the volume can be mounted as read-write by a single Node
resources:
requests:
storage: 250Mi
---
apiVersion: v1 # API version
kind: Service # Type of kubernetes resource
metadata:
name: loghme-mysql # Name of the resource
labels: # Labels that will be applied to the resource
app: loghme-mysql
spec:
ports:
- port: 3306
selector: # Selects any Pod with labels `app=polling-app,tier=mysql`
app: loghme-mysql
tier: mysql
---
apiVersion: apps/v1
kind: Deployment # Type of the kubernetes resource
metadata:
name: loghme-mysql # Name of the deployment
labels: # Labels applied to this deployment
app: loghme-mysql
spec:
selector:
matchLabels: # This deployment applies to the Pods matching the specified labels
app: loghme-mysql
tier: mysql
strategy:
type: Recreate
template: # Template for the Pods in this deployment
metadata:
labels: # Labels to be applied to the Pods in this deployment
app: loghme-mysql
tier: mysql
spec: # The spec for the containers that will be run inside the Pods in this deployment
containers:
- image: mysql # The container image
name: mysql
env: # Environment variables passed to the container
- name: MYSQL_ROOT_PASSWORD
valueFrom: # Read environment variables from kubernetes secrets
secretKeyRef:
name: mysql-root-pass
key: password
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-db-url
key: database
ports:
- containerPort: 3306 # The port that the container exposes
name: mysql
resources:
limits:
cpu: 0.4
memory: "400Mi"
volumeMounts:
- name: mysql-persistent-storage # This name should match the name specified in `volumes.name`
mountPath: /var/lib/mysql
volumes: # A PersistentVolume is mounted as a volume to the Pod
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim