From 882403258b3395061c6b2e65c51b1aceb2ce2ad6 Mon Sep 17 00:00:00 2001 From: Nicolas CARON Date: Wed, 20 Nov 2024 17:21:09 +0100 Subject: [PATCH] add diags services --- Tiltfile | 8 ++++++ k8s_config/dev/diags/config.yaml | 16 +++++++++++ k8s_config/dev/diags/deployment.yaml | 31 ++++++++++++++++++++++ k8s_config/dev/diags/kustomization.yaml | 8 ++++++ k8s_config/dev/diags/service.yaml | 11 ++++++++ k8s_config/dev/kustomization.yaml | 1 + k8s_config/dev/parcoursmob/config.yaml | 7 ++++- k8s_config/dev/parcoursmob/deployment.yaml | 2 +- 8 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 k8s_config/dev/diags/config.yaml create mode 100644 k8s_config/dev/diags/deployment.yaml create mode 100644 k8s_config/dev/diags/kustomization.yaml create mode 100644 k8s_config/dev/diags/service.yaml diff --git a/Tiltfile b/Tiltfile index 32e7f57..6d40de5 100644 --- a/Tiltfile +++ b/Tiltfile @@ -18,12 +18,14 @@ mobility_accounts_dir = os.environ.get('MOBILITY_ACCOUNTS_DIR', 'src/mobility-ac agenda_dir = os.environ.get('AGENDA_DIR', 'src/agenda') fleets_dir = os.environ.get('FLEETS_DIR', 'src/fleets') groups_management_dir = os.environ.get('GROUPS_MANAGEMENT_DIR', 'src/groups-management') +diags_dir = os.environ.get('DIAGS_DIR', 'src/diags') parcoursmob_image = os.environ.get('PARCOURSMOB_IMAGE', 'git.coopgo.io/coopgo-apps/parcoursmob') mobility_accounts_image = os.environ.get('MOBILITY_ACCOUNTS_IMAGE', 'git.coopgo.io/coopgo-platform/mobility-accounts') agenda_image = os.environ.get('AGENDA_IMAGE', 'git.coopgo.io/coopgo-platform/agenda') fleets_image = os.environ.get('FLEETS_IMAGE', 'git.coopgo.io/coopgo-platform/fleets') groups_management_image = os.environ.get('GROUPS_MANAGEMENT_IMAGE', 'git.coopgo.io/coopgo-platform/groups-management') +diags_image = os.environ.get('DIAGS_IMAGE', 'git.coopgo.io/coopgo-platform/diags') allow_k8s_contexts(allowed_k8s_context) @@ -72,5 +74,11 @@ if os.path.exists(groups_management_dir): print("Directory : {dir}".format(dir=groups_management_dir)) deploy_go('groups-management', groups_management_dir, groups_management_image) +if os.path.exists(diags_dir): + diags_dir =os.path.realpath(diags_dir) + print("DIAGS") + print("Directory : {dir}".format(dir=diags_dir)) + deploy_go('diags', diags_dir, diags_image) + k8s_yaml(kustomize('k8s_config/dev')) diff --git a/k8s_config/dev/diags/config.yaml b/k8s_config/dev/diags/config.yaml new file mode 100644 index 0000000..5dc7d0f --- /dev/null +++ b/k8s_config/dev/diags/config.yaml @@ -0,0 +1,16 @@ + +dev_env: true + +storage: + db: + type: mongodb + mongodb: + host: mongodb + port: 27017 + db_name: coopgo_platform + collections: + events: diags + +services: + grpc: + port: 8080 \ No newline at end of file diff --git a/k8s_config/dev/diags/deployment.yaml b/k8s_config/dev/diags/deployment.yaml new file mode 100644 index 0000000..9b0c488 --- /dev/null +++ b/k8s_config/dev/diags/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: diags +spec: + selector: + matchLabels: + app: diags + template: + metadata: + labels: + app: diags + spec: + containers: + - name: diags + image: git.coopgo.io/coopgo-platform/diags:dev + ports: + - name: grpc + containerPort: 8080 + protocol: TCP + volumeMounts: + - name: diags-config-volume + mountPath: /config.yaml + subPath: config.yaml + volumes: + - name: diags-config-volume + configMap: + name: diags-config + items: + - key: config.yaml + path: config.yaml diff --git a/k8s_config/dev/diags/kustomization.yaml b/k8s_config/dev/diags/kustomization.yaml new file mode 100644 index 0000000..c525965 --- /dev/null +++ b/k8s_config/dev/diags/kustomization.yaml @@ -0,0 +1,8 @@ +resources: +- deployment.yaml +- service.yaml + +configMapGenerator: +- name: diags-config + files: + - config.yaml \ No newline at end of file diff --git a/k8s_config/dev/diags/service.yaml b/k8s_config/dev/diags/service.yaml new file mode 100644 index 0000000..0dbfc09 --- /dev/null +++ b/k8s_config/dev/diags/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: diags +spec: + selector: + app: diags + ports: + - port: 8080 + name: grpc + targetPort: 8080 diff --git a/k8s_config/dev/kustomization.yaml b/k8s_config/dev/kustomization.yaml index 0852a5d..248424d 100644 --- a/k8s_config/dev/kustomization.yaml +++ b/k8s_config/dev/kustomization.yaml @@ -6,6 +6,7 @@ resources: - ./fleets/ - ./groups-management/ - ./mobility-accounts/ +- ./diags/ # Apps - ./parcoursmob/ diff --git a/k8s_config/dev/parcoursmob/config.yaml b/k8s_config/dev/parcoursmob/config.yaml index ddb614c..25917b0 100644 --- a/k8s_config/dev/parcoursmob/config.yaml +++ b/k8s_config/dev/parcoursmob/config.yaml @@ -30,6 +30,8 @@ services: dial: fleets:8080 agenda: dial: agenda:8080 + diags: + dial: diags:8080 navitia: api_key: abcd @@ -97,4 +99,7 @@ modules: - name: Auto-école sociale (classique) - name: Information collective - name: Autre - + documents_types: + - notice + - pieces + - other diff --git a/k8s_config/dev/parcoursmob/deployment.yaml b/k8s_config/dev/parcoursmob/deployment.yaml index e7e0a19..62f8e8d 100644 --- a/k8s_config/dev/parcoursmob/deployment.yaml +++ b/k8s_config/dev/parcoursmob/deployment.yaml @@ -13,7 +13,7 @@ spec: spec: containers: - name: parcoursmob - image: git.coopgo.io/coopgo-apps/parcoursmob + image: git.coopgo.io/coopgo-apps/parcoursmob:dev ports: - containerPort: 80 volumeMounts: