diff --git a/README.md b/README.md index 008bc55..68806ae 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ 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 +# remove local path and use config:, images:,tmp: + champs volume à adapter kompose convert #rm nginx* + tuning diff --git a/pigallery2-claim0-persistentvolumeclaim.yaml b/config-persistentvolumeclaim.yaml similarity index 73% rename from pigallery2-claim0-persistentvolumeclaim.yaml rename to config-persistentvolumeclaim.yaml index 7732a94..31a300d 100644 --- a/pigallery2-claim0-persistentvolumeclaim.yaml +++ b/config-persistentvolumeclaim.yaml @@ -3,8 +3,8 @@ kind: PersistentVolumeClaim metadata: creationTimestamp: null labels: - io.kompose.service: pigallery2-claim0 - name: pigallery2-claim0 + io.kompose.service: config + name: config spec: accessModes: - ReadWriteOnce diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 9799e40..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -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-claim2-persistentvolumeclaim.yaml b/images-persistentvolumeclaim.yaml similarity index 73% rename from pigallery2-claim2-persistentvolumeclaim.yaml rename to images-persistentvolumeclaim.yaml index bceb771..361fa41 100644 --- a/pigallery2-claim2-persistentvolumeclaim.yaml +++ b/images-persistentvolumeclaim.yaml @@ -3,8 +3,8 @@ kind: PersistentVolumeClaim metadata: creationTimestamp: null labels: - io.kompose.service: pigallery2-claim2 - name: pigallery2-claim2 + io.kompose.service: images + name: images spec: accessModes: - ReadWriteOnce diff --git a/ingress.yml b/ingress.yml new file mode 100644 index 0000000..adc5360 --- /dev/null +++ b/ingress.yml @@ -0,0 +1,25 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: "pigallery2-ingress" + annotations: + kubernetes.io/ingress.class: "traefik" + traefik.ingress.kubernetes.io/router.entrypoints: "web,websecure" + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + tls: + - hosts: + - "npics.opti.cabillot.eu" + secretName: "npicscabilloteu-tls" + rules: + - host: "npics.opti.cabillot.eu" + http: + paths: + - path: "/" + pathType: "Prefix" + backend: + service: + name: "pigallery2" + port: + name: "http" diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 0000000..9b5a69f --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- config-persistentvolumeclaim.yaml +- db-data-persistentvolumeclaim.yaml +- images-persistentvolumeclaim.yaml +- ingress.yml +- pigallery2-deployment.yaml +- pigallery2-service.yaml +- tmp-persistentvolumeclaim.yaml diff --git a/pigallery2-deployment.yaml b/pigallery2-deployment.yaml index a8b71e5..43d8678 100644 --- a/pigallery2-deployment.yaml +++ b/pigallery2-deployment.yaml @@ -1,53 +1,52 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.16.0 (0c01309) - creationTimestamp: null + name: "pigallery2" labels: io.kompose.service: pigallery2 - name: pigallery2 spec: - replicas: 1 strategy: type: Recreate template: metadata: - creationTimestamp: null labels: io.kompose.service: pigallery2 + app: "pigallery2" spec: + automountServiceAccountToken: false containers: - - env: + - name: "pigallery2" + image: "bpatrik/pigallery2:latest-debian-buster" + env: - name: NODE_ENV value: production - image: bpatrik/pigallery2:latest - name: pigallery2 ports: - containerPort: 80 resources: {} volumeMounts: - mountPath: /app/data/config - name: pigallery2-claim0 + name: config - mountPath: /app/data/db name: db-data - mountPath: /app/data/images - name: pigallery2-claim2 + name: images - mountPath: /app/data/tmp - name: pigallery2-claim3 + name: tmp restartPolicy: Always volumes: - - name: pigallery2-claim0 + - name: config persistentVolumeClaim: - claimName: pigallery2-claim0 + claimName: config - name: db-data persistentVolumeClaim: claimName: db-data - - name: pigallery2-claim2 + - name: images persistentVolumeClaim: - claimName: pigallery2-claim2 - - name: pigallery2-claim3 + claimName: images + - name: tmp persistentVolumeClaim: - claimName: pigallery2-claim3 -status: {} + claimName: tmp + replicas: 1 + selector: + matchLabels: + app: "pigallery2" diff --git a/pigallery2-claim3-persistentvolumeclaim.yaml b/tmp-persistentvolumeclaim.yaml similarity index 73% rename from pigallery2-claim3-persistentvolumeclaim.yaml rename to tmp-persistentvolumeclaim.yaml index f2a8e5e..732ccd3 100644 --- a/pigallery2-claim3-persistentvolumeclaim.yaml +++ b/tmp-persistentvolumeclaim.yaml @@ -3,8 +3,8 @@ kind: PersistentVolumeClaim metadata: creationTimestamp: null labels: - io.kompose.service: pigallery2-claim3 - name: pigallery2-claim3 + io.kompose.service: tmp + name: tmp spec: accessModes: - ReadWriteOnce