mysql and redis, maybe valkey future

This commit is contained in:
Sense T 2025-01-13 20:43:00 +08:00
parent 1affe72cd4
commit 5536b90ffa
8 changed files with 125 additions and 0 deletions

14
dev/kustomization.yaml Normal file
View File

@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: dev
resources:
- namespace.yaml
- mysql
- redis
images:
- name: mysql
newTag: 8.0.36-debian
- name: redis
newTag: 6.2-alpine

32
dev/mysql/deployment.yaml Normal file
View File

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
replicas: 1
template:
metadata:
labels:
app: mysql
editor: vscode
spec:
volumes:
- name: data
hostPath:
path: /data/mysql
containers:
- name: mysql
image: mysql
resources:
limits:
cpu: '1'
memory: '1Gi'
volumeMounts:
- mountPath: /var/lib/mysql
name: data
envFrom:
- secretRef:
name: mysql

View File

@ -0,0 +1,11 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
secretGenerator:
- name: mysql
files:
- config/MYSQL_ROOT_PASSWORD

10
dev/mysql/service.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
selector:
app: mysql
ports:
- port: 3306
targetPort: 3306

6
dev/namespace.yaml Normal file
View File

@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: dev
annotations:
role: 'for develop use'

31
dev/redis/deployment.yaml Normal file
View File

@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
selector:
matchLabels:
app: redis
replicas: 1
template:
metadata:
labels:
app: redis
editor: vscode
spec:
volumes:
- name: redis-config
configMap:
name: redis-config
containers:
- image: redis
name: redis
args:
- "/etc/redis/redis.conf"
resources:
limits:
cpu: '1'
memory: '1Gi'
volumeMounts:
- mountPath: /etc/redis
name: redis-config

View File

@ -0,0 +1,11 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
configMapGenerator:
- name: redis-config
files:
- config/redis.conf

10
dev/redis/service.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
app: redis
ports:
- port: 6379
targetPort: 6379