Skip to content
Open

11 #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM registry-scu.cloudtogo.cn/ubuntu:jdk
ARG app
ADD $app app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
34 changes: 34 additions & 0 deletions kube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: Service
metadata:
name: maven-service
spec:
type: NodePort
ports:
- name: maven
port: 8080
nodePort: 31002
targetPort: 8080
protocol: TCP
selector:
app: maven
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: maven-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: maven
spec:
containers:
- name: maven
image: 192.168.0.108:5000/maven:latest
ports:
- containerPort: 8080
env:
- name: key
value: "value"
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public class IndexController {
@GetMapping("")
public JSONObject hello(String name) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("random", RandomStringUtils.randomAlphabetic(16));
jsonObject.put("random11", RandomStringUtils.randomAlphabetic(16));
if (StringUtils.isNotBlank(name)) {
jsonObject.put("welcome", "hello, " + name + "!");
}
jsonObject.put("welcome1", "1");
jsonObject.put("welcome2", "2");
jsonObject.put("welcome6", "6");
logger.info("result msg: {}", jsonObject.toJSONString());
return jsonObject;
}
Expand Down