Commit c5fc8b26 authored by Mariama Tambedou's avatar Mariama Tambedou

correction

parent c8fca9a4
FROM odoo:16.0
# Installer les dépendances nécessaires
# Assurez-vous que les commandes suivantes s'exécutent avec les droits root
USER root
# Nettoyer les caches existants
RUN rm -rf /var/lib/apt/lists/*
# Mettre à jour les paquets et installer les dépendances nécessaires
RUN apt-get update && apt-get install -y \
wget \
gnupg \
apt-transport-https \
ca-certificates && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y \
git \
python3-pip \
libpq-dev \
&& rm -rf /var/lib/apt/lists/* && \
apt-get clean
# Copier les fichiers nécessaires dans le conteneur
COPY ./config/odoo.conf /etc/odoo/
......
[options]
#addons_path = /mnt/extra-addons
addons_path = /mnt/extra-addons
data_dir = /home/data
admin_passwd = p.8at(k4ER\p:BYx*L)
; csv_internal_sep = ,
; db_maxconn = 64
; db_template = template1
dbfilter = dbtest
;db_name = ijayo_crm
;list_db = False
log_level = debug
longpolling_port = 8072
proxy_mode = True
; db_template = template1
dbfilter = .*
limit_memory_hard = 1677721600
limit_memory_soft = 629145600
......@@ -27,13 +25,15 @@ workers = 3
; limit_request = 8192
; limit_time_cpu = 60
; limit_time_real = 120
list_db = true
; log_db = False
; log_handler = [':INFO']
log_level = debug
; logfile = None
;longpolling_port = 8072
; max_cron_threads = 2
gevent_port = 8072
; osv_memory_age_limit = 1.0
; osv_memory_count_limit = False
......@@ -49,4 +49,5 @@ workers = 3
; xmlrpcs = True
; xmlrpcs_interface =
; xmlrpcs_port = 8071
; proxy_mode = True
proxy_mode = True
version: "3.9"
services:
odoo:
build:
......@@ -12,9 +11,11 @@ services:
depends_on:
- db
environment:
- HOST=db
- USER=postgresadmin
- PASSWORD=admin123
- DB_HOST=db
- DB_PORT=5432
- DB_USER=odoo
- DB_PASSWORD=odoo
- ADMIN_PASSWD=p.8at(k4ER\p:BYx*L
volumes:
- ./addons:/mnt/extra-addons
- ./entreprise_addons:/mnt/extra-addons
......@@ -28,11 +29,11 @@ services:
db:
image: postgres:13
container_name: postgres-container
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgresadmin
POSTGRES_PASSWORD: admin123
volumes:
- pg-data:/var/lib/postgresql/data
- ./pg_hba.conf:/etc/postgresql/pg_hba.conf
......@@ -47,3 +48,4 @@ volumes:
networks:
odoo-network:
driver: bridge
......@@ -7,10 +7,10 @@ if [ -v PASSWORD_FILE ]; then
fi
# Utiliser les valeurs des variables d'environnement ou les valeurs par défaut
: ${HOST:=${DB_HOST:='db'}} # Mettre à jour ici le nom du conteneur PostgreSQL
: ${PORT:=${DB_PORT:=5432}}
: ${USER:=${DB_USER:='postgresadmin'}} # Utilisez l'utilisateur défini dans votre config
: ${PASSWORD:=${DB_PASS:='admin123'}} # Utilisez le mot de passe défini dans votre config
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
DB_ARGS=()
function check_config() {
......
......@@ -46,23 +46,97 @@ spec:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
env:
- name: DB_HOST
value: postgresql # Nom du service PostgreSQL
- name: DB_PORT
value: "5432"
- name: DB_USER
value: {{ .Values.postgresql.postgresqlUsername }} # Utilisateur PostgreSQL
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-db-secret # Secret contenant le mot de passe PostgreSQL
key: password
- name: DB_NAME
value: {{ .Values.postgresql.postgresqlDatabase }} # Nom de la base de données
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
volumes:
- name: odoo-db-pv
persistentVolumeClaim:
claimName: odoo-db-pvc # PVC pour PostgreSQL si vous l'avez configuré
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- toYaml .Values.affinity | nindent 8 }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- toYaml .Values.tolerations | nindent 8 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgresql
labels:
app: postgresql
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: "postgres:13" # Image de PostgreSQL
env:
- name: POSTGRES_USER
value: {{ .Values.postgresql.postgresqlUsername }} # Utilisateur PostgreSQL
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-db-secret # Secret contenant le mot de passe PostgreSQL
key: password
- name: POSTGRES_DB
value: {{ .Values.postgresql.postgresqlDatabase }} # Nom de la base de données
volumeMounts:
- name: postgresql-data
mountPath: /var/lib/postgresql/data
volumes:
- name: postgresql-data
persistentVolumeClaim:
claimName: postgresql-pvc # PVC pour PostgreSQL
---
apiVersion: v1
kind: Service
metadata:
name: postgresql
spec:
ports:
- port: 5432
selector:
app: postgresql
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "my-odoo-app.fullname" . }}
spec:
ports:
- port: {{ .Values.service.port }}
targetPort: 8069
selector:
app: {{ include "my-odoo-app.fullname" . }}
......@@ -7,10 +7,39 @@ replicaCount: 1
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
repository: tambedou/odoo # Remplacez par le nom de votre image Docker
repository: tambedou/odoo-image # Remplacez par le nom de votre image Docker
tag: latest # Vous pouvez définir une version spécifique si vous le souhaitez
pullPolicy: IfNotPresent
env:
- name: DB_HOST
value: "postgresql"
- name: DB_PORT
value: "5432"
- name: DB_USER
value: "postgresadmin"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-db-secret
key: password
postgresql:
image:
repository: postgres
tag: 13
service:
type: ClusterIP
port: 5432
env:
- name: POSTGRES_USER
value: "postgresadmin"
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-db-secret
key: password
# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
#imagePullSecrets: []
# This is to override the chart name.
......@@ -76,31 +105,32 @@ ingress:
# hosts:
# - chart-example.local
resources: {}
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1"
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30 # Délai initial pour éviter des erreurs au démarrage
port: 8069
initialDelaySeconds: 60 # Délai initial pour éviter des erreurs au démarrage
periodSeconds: 10 # Fréquence des vérifications
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
port: 8069
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
......
DB_HOST = db
DB_PORT = 5432
DB_USER = postgresadmin
DB_PASS = admin123
db_name = ijayo_crm
DB_HOST=postgres-container
DB_PORT=5432
DB_USER=postgresadmin
DB_PASS=admin123
apiVersion: v1
kind: Secret
metadata:
name: odoo-db-secret
type: Opaque
data:
password: YWRtaW4xMjM= # Remplacez par le mot de passe encodé en base64
apiVersion: v1
kind: Secret
metadata:
name: odoo-db-secret
type: Opaque
data:
password: YWRtaW4xMjM= # Remplacez par le mot de passe encodé en base64
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment