diff --git a/dev/kustomization.yaml b/dev/kustomization.yaml new file mode 100644 index 0000000..e35dde5 --- /dev/null +++ b/dev/kustomization.yaml @@ -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 diff --git a/dev/mysql/deployment.yaml b/dev/mysql/deployment.yaml new file mode 100644 index 0000000..26bf525 --- /dev/null +++ b/dev/mysql/deployment.yaml @@ -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 \ No newline at end of file diff --git a/dev/mysql/kustomization.yaml b/dev/mysql/kustomization.yaml new file mode 100644 index 0000000..8be85c7 --- /dev/null +++ b/dev/mysql/kustomization.yaml @@ -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 diff --git a/dev/mysql/service.yaml b/dev/mysql/service.yaml new file mode 100644 index 0000000..911a618 --- /dev/null +++ b/dev/mysql/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql +spec: + selector: + app: mysql + ports: + - port: 3306 + targetPort: 3306 diff --git a/dev/namespace.yaml b/dev/namespace.yaml new file mode 100644 index 0000000..0ec19a1 --- /dev/null +++ b/dev/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: dev + annotations: + role: 'for develop use' \ No newline at end of file diff --git a/dev/redis/deployment.yaml b/dev/redis/deployment.yaml new file mode 100644 index 0000000..6a55879 --- /dev/null +++ b/dev/redis/deployment.yaml @@ -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 diff --git a/dev/redis/kustomization.yaml b/dev/redis/kustomization.yaml new file mode 100644 index 0000000..05f4c91 --- /dev/null +++ b/dev/redis/kustomization.yaml @@ -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 \ No newline at end of file diff --git a/dev/redis/service.yaml b/dev/redis/service.yaml new file mode 100644 index 0000000..1cf99e6 --- /dev/null +++ b/dev/redis/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis +spec: + selector: + app: redis + ports: + - port: 6379 + targetPort: 6379 \ No newline at end of file