Skip to content

Commit

Permalink
Merge branch 'feat/kubernetes' into feat/kubernetes-nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjourne authored Feb 13, 2024
2 parents 6f1e03e + c326a6b commit bfd039c
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 46 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export APP = moteur-de-recherche
export APP_PATH := $(shell pwd)
export APP_VERSION := 2.6
export APP_VERSION := 2.7
export DATA_PATH = ${APP_PATH}/backend/tests/iga/data
#export APP_VERSION := $(shell git describe --tags || cat VERSION )

Expand Down Expand Up @@ -185,7 +185,8 @@ deploy-k8s-configmap: create-namespace

deploy-k8s-volume: create-namespace
@cat ${KUBE_DIR}/volume.yaml | envsubst | kubectl apply -f -

{KUBE_DIR}/volume.yaml | envsubst | kubectl apply -f -

deploy-k8s-ekl: create-namespace
@echo $@
#@cat ${KUBE_DIR}/ekl/elasticsearch.yaml | envsubst | helm upgrade --install elasticsearch elastic/elasticsearch -n ridoc -f -
Expand Down
4 changes: 2 additions & 2 deletions artifacts.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export DC=docker-compose
export INDEX_NAME = bld
export DATA_PATH = /data
export INDEX_NAME = iga
export DATA_PATH = ${APP_PATH}/backend/tests/${INDEX_NAME}/data
export ENV_FILE = ${APP_PATH}/backend/tests/${INDEX_NAME}/.env-${INDEX_NAME}
export FRONTEND_STATIC_USER=${APP_PATH}/backend/tests/${INDEX_NAME}/static
export DC_UP_ARGS=
54 changes: 49 additions & 5 deletions deployments/traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ deployment:
volumeMounts:
- mountPath: /data
name: traefik-internal
# additionalContainers:
# - name: stream-accesslog
# args:
# - /bin/sh
# - -c
# - tail -n+1 -F /tmp/traefik/access.log
# image: busybox
# imagePullPolicy: Always
# resources: {}
# terminationMessagePath: /dev/termination-log
# terminationMessagePolicy: File
# volumeMounts:
# - mountPath: /tmp/traefik
# name: traefik-logs
# readOnly: true

additionalVolumes:
- name: traefik-logs
hostPath:
path: /tmp


updateStrategy:
Expand All @@ -64,20 +84,33 @@ updateStrategy:
maxUnavailable: 1
maxSurge: 0

additionalVolumeMounts:
- name: traefik-logs
mountPath: /tmp/traefik

logs:
general:
# Alternative logging levels are DEBUG, PANIC, FATAL, ERROR, WARN, and INFO.
level: INFO
# format: json
access:
# To enable access logs
enabled: true
# format: json
## By default, logs are written using the Common Log Format (CLF) on stdout.
## To write logs in JSON, use json in the format option.
## If the given format is unsupported, the default (CLF) is used instead.
# format: json
filePath: "/tmp/logs/access.log"


filePath: "/tmp/traefik/access.log"
# filters:
# minDuration: "1ms"
# statuscodes: "200_209"
# headers:
# defaultmode: drop
# names:
# ## Examples:
# # User-Agent: redact
# # Authorization: drop
# # Content-Type: keep
ingressRoute:
dashboard:
enabled: true
Expand Down Expand Up @@ -107,4 +140,15 @@ extraObjects:
namespace: traefik
spec:
basicAuth:
secret: traefik-dashboard-auth-secret
secret: traefik-dashboard-auth-secret

# - apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: traefik-access-log
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 10Mi
5 changes: 5 additions & 0 deletions frontend/src/layouts/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
</script>

<style>
nav {
height: 6rem;
}
[aria-current] {
position: relative !important;
}
Expand Down
97 changes: 60 additions & 37 deletions frontend/src/routes/search/index.svelte
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
<svelte:head>
<title>Rechercher</title>
</svelte:head>

<script>
import { onMount } from 'svelte';
import { envJson } from '../../components/user-data.store';
import { promiseSearch } from './stores.js';
import { itemJson, searchJson } from '../../components/user-data.store';
import { flatten, format2ES, search } from '../../components/utils.js';
import SearchBar from './SearchBar.svelte';
import ResultList from './ResultList.svelte';
import Aside from './aside.svelte';
import { onMount } from "svelte";
import { envJson } from "../../components/user-data.store";
import { promiseSearch } from "./stores.js";
import { itemJson, searchJson } from "../../components/user-data.store";
import { flatten, format2ES, search } from "../../components/utils.js";
import SearchBar from "./SearchBar.svelte";
import ResultList from "./ResultList.svelte";
import Aside from "./aside.svelte";
let body
let body;
onMount(async () => {
//initial search
if ($envJson.initialSearch) {
body = format2ES($itemJson, flatten($searchJson, 2), $envJson.index_name)
$promiseSearch = search(body)
body = format2ES(
$itemJson,
flatten($searchJson, 2),
$envJson.index_name,
);
$promiseSearch = search(body);
}
});
</script>

<svelte:head>
<title>Rechercher</title>
</svelte:head>

<div class="wrapper">

<div class="search">
<SearchBar/>
<SearchBar />
</div>

<div class="aside">
<Aside/>
<Aside />
</div>

<div class="result">
<!-- <Aside/> -->
<ResultList/>
<ResultList />
</div>
</div>

<style>
/*
/*
.result {
background: deepskyblue;
}
Expand All @@ -50,22 +56,39 @@
background: green;
} */
.wrapper {
display: flex;
flex-flow: row wrap;
font-weight: bold;
text-align: center;
}
.wrapper {
display: flex;
flex-flow: row wrap;
/* font-weight: bold;
text-align: center; */
}
.wrapper > * {
/* padding: 10px; */
flex: 1 100%;
}
/* .search { flex: 3 0px; } */
.aside { flex: 1 1 auto; }
.result { flex: 1 1 auto; }
/* .search { order: 0; }
.aside { order: 1; }
.result { order: 2; } */
.wrapper > * {
/* padding: 10px; */
flex: 1 100%;
}
/* .search { flex: 3 0px; } */
.aside {
position: sticky; /* Make the sidebar immovable*/
/* position: -webkit-sticky; */
z-index: 1; /*Side bar stays at the top*/
top: 0rem;
/* border-style: solid;
border: 1px;
border-color: red;
border-style: solid; */
max-width: 15%;
align-self: flex-start;
}
</style>
.result {
/* flex: 1 1 auto; */
/* border: 1px;
border-color: blue;
border-style: solid; */
max-width: 85%;
}
.search { order: 0; }
.aside { order: 1; }
.result { order: 2; }
</style>

0 comments on commit bfd039c

Please sign in to comment.