Ajout de la presentation et des manifests de deploiement

main
nwanono 2023-04-23 17:27:59 +02:00
parent 9cc2a55a4e
commit 7aed364c7e
9 changed files with 138 additions and 0 deletions

View File

@ -36,6 +36,13 @@
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
<build>

View File

@ -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<HostNameInfo> getInfo() {
// Log de la requete
LOGGER.info("Requete recue !");
// Retour de
return Mono.just(infos);
}
}

View File

@ -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

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: fb-app

37
manifests/fbapp/pod.yaml Normal file
View File

@ -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

View File

@ -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

View File

@ -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"