diff --git a/Friday Booster - Azure & Kubernetes - 2023-v1.1.pptx b/Friday Booster - Azure & Kubernetes - 2023-v1.1.pptx index e63818b..ff425e0 100644 Binary files a/Friday Booster - Azure & Kubernetes - 2023-v1.1.pptx and b/Friday Booster - Azure & Kubernetes - 2023-v1.1.pptx differ diff --git a/fb-app/pom.xml b/fb-app/pom.xml index 22a860d..e42fb96 100644 --- a/fb-app/pom.xml +++ b/fb-app/pom.xml @@ -36,6 +36,13 @@ reactor-test test + + + org.springframework.boot + spring-boot-devtools + runtime + true + diff --git a/fb-app/src/main/java/com/capgemini/fridaybooster/kubernetes/fbapp/controller/TestController.java b/fb-app/src/main/java/com/capgemini/fridaybooster/kubernetes/fbapp/controller/TestController.java index 2c7a3f0..852a4c9 100644 --- a/fb-app/src/main/java/com/capgemini/fridaybooster/kubernetes/fbapp/controller/TestController.java +++ b/fb-app/src/main/java/com/capgemini/fridaybooster/kubernetes/fbapp/controller/TestController.java @@ -3,6 +3,8 @@ package com.capgemini.fridaybooster.kubernetes.fbapp.controller; import java.net.Inet4Address; import java.net.UnknownHostException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -16,6 +18,8 @@ import reactor.core.publisher.Mono; @RequestMapping("/") public class TestController { + private static final Logger LOGGER = LoggerFactory.getLogger(TestController.class); + private final HostNameInfo infos; public TestController(@Value("${message}") String message) throws UnknownHostException { @@ -27,6 +31,10 @@ public class TestController { @GetMapping("/") public Mono getInfo() { + // Log de la requete + LOGGER.info("Requete recue !"); + + // Retour de return Mono.just(infos); } } diff --git a/manifests/fbapp/deployment.yaml b/manifests/fbapp/deployment.yaml new file mode 100644 index 0000000..f097937 --- /dev/null +++ b/manifests/fbapp/deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fb-app-deployment + namespace: fb-app +spec: + replicas: 3 + selector: + matchLabels: + app: fb-app + template: + metadata: + labels: + app: fb-app + spec: + containers: + - name: fb-app + image: registry.wanono-corp.com/capgemini/friday-booster-2023/fbapp:1.0.0 + env: + - name: ENV_MESSAGE + value: "Mon message" + resources: + limits: + memory: 256Mi + cpu: 500m + ports: + - name: http + protocol: TCP + containerPort: 8080 + readinessProbe: + httpGet: + port: http + path: / + initialDelaySeconds: 10 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + httpGet: + port: http + path: / + initialDelaySeconds: 30 + periodSeconds: 5 + failureThreshold: 1 + timeoutSeconds: 5 + \ No newline at end of file diff --git a/manifests/fbapp/namespace.yaml b/manifests/fbapp/namespace.yaml new file mode 100644 index 0000000..5a1c700 --- /dev/null +++ b/manifests/fbapp/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: fb-app \ No newline at end of file diff --git a/manifests/fbapp/pod.yaml b/manifests/fbapp/pod.yaml new file mode 100644 index 0000000..3d659cb --- /dev/null +++ b/manifests/fbapp/pod.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Pod +metadata: + name: fp-app-pod + namespace: fb-app +spec: + containers: + - name: fb-app + image: registry.wanono-corp.com/capgemini/friday-booster-2023/fbapp:1.0.0 + env: + - name: ENV_MESSAGE + value: "Mon message" + resources: + limits: + memory: 256Mi + cpu: 500m + ports: + - name: http + protocol: TCP + containerPort: 8080 + readinessProbe: + httpGet: + port: http + path: / + initialDelaySeconds: 10 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + httpGet: + port: http + path: / + initialDelaySeconds: 30 + periodSeconds: 5 + failureThreshold: 1 + timeoutSeconds: 5 + \ No newline at end of file diff --git a/manifests/fbapp/service.yaml b/manifests/fbapp/service.yaml new file mode 100644 index 0000000..34f2cc6 --- /dev/null +++ b/manifests/fbapp/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: fb-app + namespace: fb-app +spec: + type: ClusterIP + selector: + app: fb-app + ports: + - name: http + port: 8080 + targetPort: http diff --git a/manifests/test/namespaceAndPod.yaml b/manifests/test/namespaceAndPod.yaml new file mode 100644 index 0000000..d8e59a6 --- /dev/null +++ b/manifests/test/namespaceAndPod.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: test +--- +apiVersion: v1 +kind: Pod +metadata: + name: test-pod + namespace: test + labels: + name: test +spec: + containers: + - name: shell-container + image: registry.wanono-corp.com/capgemini/friday-booster-2023/proxy-shell:1.0.0 + command: + - sleep + - infinity + resources: + limits: + memory: "128Mi" + cpu: "500m" diff --git a/test-pod/Dockerfile b/proxy-shell/Dockerfile similarity index 100% rename from test-pod/Dockerfile rename to proxy-shell/Dockerfile