Ajout de la presentation et des manifests de deploiement
parent
9cc2a55a4e
commit
7aed364c7e
Binary file not shown.
|
|
@ -36,6 +36,13 @@
|
||||||
<artifactId>reactor-test</artifactId>
|
<artifactId>reactor-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.capgemini.fridaybooster.kubernetes.fbapp.controller;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -16,6 +18,8 @@ import reactor.core.publisher.Mono;
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public class TestController {
|
public class TestController {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(TestController.class);
|
||||||
|
|
||||||
private final HostNameInfo infos;
|
private final HostNameInfo infos;
|
||||||
|
|
||||||
public TestController(@Value("${message}") String message) throws UnknownHostException {
|
public TestController(@Value("${message}") String message) throws UnknownHostException {
|
||||||
|
|
@ -27,6 +31,10 @@ public class TestController {
|
||||||
|
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public Mono<HostNameInfo> getInfo() {
|
public Mono<HostNameInfo> getInfo() {
|
||||||
|
// Log de la requete
|
||||||
|
LOGGER.info("Requete recue !");
|
||||||
|
|
||||||
|
// Retour de
|
||||||
return Mono.just(infos);
|
return Mono.just(infos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: fb-app
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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"
|
||||||
Loading…
Reference in New Issue