增加了k8s devops的配置

This commit is contained in:
bamanker
2023-11-23 15:08:12 +08:00
parent eaec895ff0
commit 90c2dc3a05
2 changed files with 15 additions and 15 deletions

View File

@@ -1,8 +1,6 @@
FROM ubuntu:jammy-20231004
MAINTAINER bamanker
ARG NATIVE_FILE
ENV NATIVE_FILE=${NATIVE_FILE}
COPY target/${NATIVE_FILE} /home/${NATIVE_FILE}/app
COPY target/dailylove /home/dailylove/app
EXPOSE 13145
WORKDIR /home/${NATIVE_FILE}/out
ENTRYPOINT /home/${NATIVE_FILE}/app -XX:StartFlightRecording='filename=recording.jfr,dumponexit=true,duration=10s'
WORKDIR /home/dailylove/out
ENTRYPOINT /home/dailylove/app -XX:StartFlightRecording='filename=recording.jfr,dumponexit=true,duration=10s'

View File

@@ -2,15 +2,16 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: dailylove
name: dailylove
app: $APP_NAME
version: $TAG
name: $APP_NAME
namespace: my-proj #一定要写名称空间
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
app: dailylove
app: $APP_NAME
strategy:
rollingUpdate:
maxSurge: 50%
@@ -19,7 +20,8 @@ spec:
template:
metadata:
labels:
app: dailylove
app: $APP_NAME
version: $TAG
spec:
imagePullSecrets:
- name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码
@@ -27,7 +29,7 @@ spec:
- image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG
readinessProbe:
httpGet:
path: /
path: /actuator/health
port: 8080
timeoutSeconds: 10
failureThreshold: 30
@@ -51,8 +53,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: dailylove
name: dailylove
app: $APP_NAME
name: $APP_NAME
namespace: my-proj
spec:
ports:
@@ -61,14 +63,14 @@ spec:
protocol: TCP
targetPort: 13146
selector:
app: dailylove
app: $APP_NAME
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: dailylove # ServiceAccount的名字
name: $APP_NAME # ServiceAccount的名字
namespace: my-proj # serviceaccount的namespace
labels:
app: dailylove #ServiceAccount的标签
app: $APP_NAME #ServiceAccount的标签