<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sap</groupId>
<artifactId>tomaop2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>tomaop2</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.sap.tomaop2.controller;
import com.sap.tomaop2.model.Employee;
import com.sap.tomaop2.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class EmployeeController {
@Autowired
private EmployeeService employeeService;
@GetMapping(path = "/add/employee")
public Employee createEmployee(@RequestParam("empId") String empId,@RequestParam("firstName") String firstName,@RequestParam("secondName") String secondName){
return employeeService.createEmployee(empId,firstName,secondName);
}
@GetMapping(path = "/del/employee")
public String deleteEmployee(@RequestParam("empId") String empId){
employeeService.deleteEmployee(empId);
return "The employe " + empId +" has been deleted";
}
}
mvn compile jib:buildTar
apiVersion: apps/v1
kind: Deployment
metadata:
name: tomaop
labels:
app: tomaop
spec:
selector:
matchLabels:
app: tomaop
strategy:
rollingUpdate:
maxUnavailable: 1
replicas: 1
template:
metadata:
labels:
app: tomaop
spec:
containers:
- image: registry.hub.docker.com/dockeraccount/springbootaop:latest
imagePullPolicy: Always
name: tomaop
ports:
- name: http
containerPort: 8080
env:
- name: DEBUG
value: "true"
- name: RENEWCERT_JOB_CRON
value: "00 00 */12 * * *"
resources:
requests:
memory: "512Mi"
cpu: "50m"
limits:
memory: "1000Mi"
cpu: "100m"
---
apiVersion: v1
kind: Service
metadata:
name: tomaop
labels:
app: tomaop
spec:
ports:
- name: http
port: 8080
selector:
app: tomaop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
25 | |
21 | |
12 | |
9 | |
8 | |
8 | |
8 | |
8 | |
8 |