From 0b62da643dcda676809660c4782dfc3a5e6e5fbb Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Tue, 29 Jun 2021 12:02:54 -0400 Subject: [PATCH] wip --- README.md | 12 ++++- db-data-persistentvolumeclaim.yaml | 14 ++++++ docker-compose.yml | 18 +++++++ pigallery2-claim0-persistentvolumeclaim.yaml | 14 ++++++ pigallery2-claim2-persistentvolumeclaim.yaml | 14 ++++++ pigallery2-claim3-persistentvolumeclaim.yaml | 14 ++++++ pigallery2-deployment.yaml | 53 ++++++++++++++++++++ pigallery2-service.yaml | 19 +++++++ 8 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 db-data-persistentvolumeclaim.yaml create mode 100644 docker-compose.yml create mode 100644 pigallery2-claim0-persistentvolumeclaim.yaml create mode 100644 pigallery2-claim2-persistentvolumeclaim.yaml create mode 100644 pigallery2-claim3-persistentvolumeclaim.yaml create mode 100644 pigallery2-deployment.yaml create mode 100644 pigallery2-service.yaml diff --git a/README.md b/README.md index 258649e..008bc55 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,12 @@ -# pigallery2-k8s +Choix d'utiliser mysql: +https://github.com/bpatrik/pigallery2 (SQL database and no-database mode) +MySQL: permet plus d'options de recherche +Mais pour commencer on va utiliser sqlite :) + +Comment reproduire: +#wget https://raw.githubusercontent.com/bpatrik/pigallery2/master/docker/docker-compose/with-mysql/docker-compose.yml +wget https://raw.githubusercontent.com/bpatrik/pigallery2/master/docker/docker-compose/pigallery2-only/docker-compose.yml +kompose convert +#rm nginx* ++ tuning diff --git a/db-data-persistentvolumeclaim.yaml b/db-data-persistentvolumeclaim.yaml new file mode 100644 index 0000000..593d141 --- /dev/null +++ b/db-data-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: db-data + name: db-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9799e40 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' +services: + pigallery2: + image: bpatrik/pigallery2:latest + container_name: pigallery2 + environment: + - NODE_ENV=production + volumes: + - "./pigallery2/config:/app/data/config" # CHANGE ME + - "db-data:/app/data/db" + - "./pigallery2/images:/app/data/images" # CHANGE ME + - "./pigallery2/tmp:/app/data/tmp" # CHANGE ME + ports: + - 80:80 + restart: always + +volumes: + db-data: diff --git a/pigallery2-claim0-persistentvolumeclaim.yaml b/pigallery2-claim0-persistentvolumeclaim.yaml new file mode 100644 index 0000000..7732a94 --- /dev/null +++ b/pigallery2-claim0-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: pigallery2-claim0 + name: pigallery2-claim0 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/pigallery2-claim2-persistentvolumeclaim.yaml b/pigallery2-claim2-persistentvolumeclaim.yaml new file mode 100644 index 0000000..bceb771 --- /dev/null +++ b/pigallery2-claim2-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: pigallery2-claim2 + name: pigallery2-claim2 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/pigallery2-claim3-persistentvolumeclaim.yaml b/pigallery2-claim3-persistentvolumeclaim.yaml new file mode 100644 index 0000000..f2a8e5e --- /dev/null +++ b/pigallery2-claim3-persistentvolumeclaim.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: pigallery2-claim3 + name: pigallery2-claim3 +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/pigallery2-deployment.yaml b/pigallery2-deployment.yaml new file mode 100644 index 0000000..a8b71e5 --- /dev/null +++ b/pigallery2-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.16.0 (0c01309) + creationTimestamp: null + labels: + io.kompose.service: pigallery2 + name: pigallery2 +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + creationTimestamp: null + labels: + io.kompose.service: pigallery2 + spec: + containers: + - env: + - name: NODE_ENV + value: production + image: bpatrik/pigallery2:latest + name: pigallery2 + ports: + - containerPort: 80 + resources: {} + volumeMounts: + - mountPath: /app/data/config + name: pigallery2-claim0 + - mountPath: /app/data/db + name: db-data + - mountPath: /app/data/images + name: pigallery2-claim2 + - mountPath: /app/data/tmp + name: pigallery2-claim3 + restartPolicy: Always + volumes: + - name: pigallery2-claim0 + persistentVolumeClaim: + claimName: pigallery2-claim0 + - name: db-data + persistentVolumeClaim: + claimName: db-data + - name: pigallery2-claim2 + persistentVolumeClaim: + claimName: pigallery2-claim2 + - name: pigallery2-claim3 + persistentVolumeClaim: + claimName: pigallery2-claim3 +status: {} diff --git a/pigallery2-service.yaml b/pigallery2-service.yaml new file mode 100644 index 0000000..75b5a54 --- /dev/null +++ b/pigallery2-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert + kompose.version: 1.16.0 (0c01309) + creationTimestamp: null + labels: + io.kompose.service: pigallery2 + name: pigallery2 +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: pigallery2 +status: + loadBalancer: {}