diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..77738287f0e619e47739347e957fda11878d3fff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ \ No newline at end of file diff --git a/dist/cdb/templates/api-config.yaml b/dist/cdb/templates/api-config.yaml deleted file mode 100644 index 3d39595639e1be4074d0f275aaf6d0ffb6650759..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/api-config.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Source: cdb/templates/api-config.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: api-config -data: - db-endpoint: pg-service:5432 diff --git a/dist/cdb/templates/api-deployment.yaml b/dist/cdb/templates/api-deployment.yaml deleted file mode 100644 index 2cafec3f8b0a06bfce04fd9e736d4e7ed1b38662..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/api-deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ ---- -# Source: cdb/templates/api-deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: api - labels: - app: api -spec: - #replicas: 1 - selector: - matchLabels: - app: api - template: - metadata: - labels: - app: api - spec: - securityContext: - runAsUser: 1001 - runAsGroup: 1001 - containers: - - name: api - image: registry.gitlab.com/takima-school/images/cdb/api:latest - ports: - - containerPort: 80 - env: - - name: DB_ENDPOINT - valueFrom: - configMapKeyRef: - name: api-config - key: db-endpoint - - name: POSTGRES_DB - valueFrom: - configMapKeyRef: - name: pg-config - key: db-name - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: pg-credentials - key: user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: pg-credentials - key: password - resources: - limits: - memory: "256Mi" - cpu: "1" - requests: - memory: "192Mi" - cpu: "100m" - livenessProbe: - httpGet: - path: /actuator/health/liveness # Endpoint à vérifier pour la sonde - port: 8080 # Port sur lequel le conteneur écoute - initialDelaySeconds: 30 # Délai avant de démarrer la première sonde après le démarrage du conteneur - periodSeconds: 10 # Période entre chaque sondage - readinessProbe: - httpGet: - path: /actuator/health/readiness - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - imagePullSecrets: - - name: takima-school-registry diff --git a/dist/cdb/templates/api-ingress.yaml b/dist/cdb/templates/api-ingress.yaml deleted file mode 100644 index e0065bb1d96a49e3241fe3036d966475e355eb95..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/api-ingress.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Source: cdb/templates/api-ingress.yaml -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/ingress.class: nginx - name: api-ingress -spec: - rules: - - host: api.wbensidhoum.takima.school - http: - paths: - - backend: - service: - name: api-service - port: - number: 80 - path: / - pathType: Prefix diff --git a/dist/cdb/templates/api-service.yaml b/dist/cdb/templates/api-service.yaml deleted file mode 100644 index 1cc3a895cb575e45243ff4be49addd4815c90dea..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/api-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Source: cdb/templates/api-service.yaml -apiVersion: v1 -kind: Service -metadata: - name: api-service -spec: - selector: - app: api - ports: - - protocol: TCP - port: 80 - targetPort: 8080 diff --git a/dist/cdb/templates/front-config.yaml b/dist/cdb/templates/front-config.yaml deleted file mode 100644 index 8e19226d67b873d1927483d701f986aa13df41ad..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/front-config.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Source: cdb/templates/front-config.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: cdb-front -data: - API_URL: "http://api.wbensidhoum.takima.school" diff --git a/dist/cdb/templates/front-deployment.yaml b/dist/cdb/templates/front-deployment.yaml deleted file mode 100644 index 86edd8affbbed64f30f3af9c19ff7b7b878c9a51..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/front-deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ ---- -# Source: cdb/templates/front-deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cdb-front - labels: - app: front -spec: - replicas: 1 - selector: - matchLabels: - app: front - template: - metadata: - labels: - app: front - spec: - imagePullSecrets: - - name: takima-school-registry - securityContext: - runAsUser: 101 - runAsGroup: 101 - - containers: - - name: front - image: registry.gitlab.com/takima-school/images/cdb/www:latest - imagePullPolicy: Always - ports: - - containerPort: 8080 - resources: - requests: - memory: "32M" - cpu: "0.1" - limits: - memory: "128M" - cpu: "1" - startupProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 1 - successThreshold: 1 - failureThreshold: 5 - livenessProbe: - httpGet: - path: /health - port: 8080 - periodSeconds: 3 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - httpGet: - path: /health - port: 8080 - periodSeconds: 1 - successThreshold: 1 - failureThreshold: 3 - securityContext: - allowPrivilegeEscalation: false - - env: - - name: API_URL - valueFrom: - configMapKeyRef: - name: cdb-front - key: API_URL diff --git a/dist/cdb/templates/front-ingress.yaml b/dist/cdb/templates/front-ingress.yaml deleted file mode 100644 index edd7da1b50b896daebb40f682a265b79ff83af05..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/front-ingress.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Source: cdb/templates/front-ingress.yaml -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/ingress.class: nginx - name: cdb-front -spec: - rules: - - host: www.wbensidhoum.takima.school - http: - paths: - - backend: - service: - name: cdb-front - port: - number: 80 - path: / - pathType: Prefix diff --git a/dist/cdb/templates/front-service.yaml b/dist/cdb/templates/front-service.yaml deleted file mode 100644 index eb70755e5888dfd97bde580e3c0c1443f4ce9686..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/front-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Source: cdb/templates/front-service.yaml -apiVersion: v1 -kind: Service -metadata: - name: cdb-front -spec: - selector: - app: front - ports: - - protocol: TCP - port: 80 - targetPort: 8080 diff --git a/dist/cdb/templates/pg-config.yaml b/dist/cdb/templates/pg-config.yaml deleted file mode 100644 index d43b4887052bdc533a1d8003bd9915504196b253..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/pg-config.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Source: cdb/templates/pg-config.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: pg-config -data: - db-name: cdb-db - db_path: "/var/lib/postgresql/data/pgdata" diff --git a/dist/cdb/templates/pg-credentials.yaml b/dist/cdb/templates/pg-credentials.yaml deleted file mode 100644 index 58be43e3479860b2e533b6cc429c665e7e2471ad..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/pg-credentials.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Source: cdb/templates/pg-credentials.yaml -apiVersion: v1 -kind: Secret -metadata: - name: pg-credentials -type: Opaque -data: - user: d2lzc2Vt - password: d2lzc2Vt diff --git a/dist/cdb/templates/pg-deployment.yaml b/dist/cdb/templates/pg-deployment.yaml deleted file mode 100644 index d73cee2b47f2ad1ccc71c242af8b018e56e92a90..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/pg-deployment.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -# Source: cdb/templates/pg-deployment.yaml -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: pg - labels: - app: pg -spec: - volumeClaimTemplates: - - metadata: - name: pg-data - spec: - accessModes: ["ReadWriteOnce"] - resources: - requests: - storage: 1Gi - replicas: 3 - serviceName: pg-service - selector: - matchLabels: - app: pg - template: - metadata: - labels: - app: pg - spec: - containers: - - name: pg - image: registry.takima.io/school/proxy/postgres:latest - ports: - - containerPort: 5432 - env: - - name: POSTGRES_DB - valueFrom: - configMapKeyRef: - name: pg-config - key: db-name - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: pg-credentials - key: user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: pg-credentials - key: password - - name: PGDATA - valueFrom: - configMapKeyRef: - name: pg-config # Nom du configmap - key: db_path # nom de la clef dans le configMap contenant path ou installer la db dans le volume persistant - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: pg-data - imagePullSecrets: - - name: takima-school-registry diff --git a/dist/cdb/templates/pg-service.yaml b/dist/cdb/templates/pg-service.yaml deleted file mode 100644 index b0067deb304fd265ee55ab6ef3dd8d74d3239b39..0000000000000000000000000000000000000000 --- a/dist/cdb/templates/pg-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Source: cdb/templates/pg-service.yaml -apiVersion: v1 -kind: Service -metadata: - name: pg-service -spec: - selector: - app: pg - ports: - - port: 5432 - targetPort: 5432 - protocol: TCP