264 lines
7.9 KiB
YAML
264 lines
7.9 KiB
YAML
---
|
|
# 存储
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: bigdata-sync-flink-streaming-platform-web-mysql
|
|
namespace: bigdata-sync
|
|
spec:
|
|
capacity:
|
|
storage: 100Gi
|
|
volumeMode: Filesystem
|
|
accessModes:
|
|
- ReadWriteMany
|
|
persistentVolumeReclaimPolicy: Retain
|
|
storageClassName: local-storage
|
|
local:
|
|
path: /k8slpv/bigdata-sync/flink-streaming-platform-web
|
|
nodeAffinity:
|
|
required:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/hostname
|
|
operator: In
|
|
values:
|
|
- 192.168.90.11
|
|
---
|
|
# 存储声明
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: flink-streaming-platform-web-mysql
|
|
namespace: bigdata-sync
|
|
spec:
|
|
storageClassName: local-storage
|
|
volumeName: bigdata-sync-flink-streaming-platform-web-mysql
|
|
volumeMode: Filesystem
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 100Gi
|
|
---
|
|
# 外部域名
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: flink-streaming-platform-web
|
|
namespace: bigdata-sync
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
|
spec:
|
|
rules:
|
|
- host: web-bigdata-sync.local.wangjiahuan.com
|
|
http:
|
|
paths:
|
|
- pathType: Prefix
|
|
path: "/"
|
|
backend:
|
|
service:
|
|
name: flink-streaming-platform-web
|
|
port:
|
|
number: 8080
|
|
---
|
|
# 内部域名
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: flink-streaming-platform-web
|
|
namespace: bigdata-sync
|
|
spec:
|
|
type: LoadBalancer
|
|
ports:
|
|
- name: for-8080
|
|
port: 8080
|
|
targetPort: 8080
|
|
- name: for-3306
|
|
port: 3306
|
|
targetPort: 3306
|
|
selector:
|
|
app: flink-streaming-platform-web
|
|
#---
|
|
## 配置文件
|
|
#apiVersion: v1
|
|
#kind: ConfigMap
|
|
#metadata:
|
|
# name: flink-streaming-platform-web
|
|
# namespace: bigdata-sync
|
|
#data:
|
|
# application.properties: |
|
|
# ####jdbc信息
|
|
# server.port=8080
|
|
# spring.datasource.url=jdbc:mysql://127.0.0.1:3306/flink_web?characterEncoding=UTF-8&useSSL=false
|
|
# spring.datasource.username=flink_web_test
|
|
# spring.datasource.password=flink_web_test_123
|
|
---
|
|
# 服务
|
|
---
|
|
# 服务
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: flink-streaming-platform-web
|
|
namespace: bigdata-sync
|
|
labels:
|
|
app: flink-streaming-platform-web
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: flink-streaming-platform-web
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: flink-streaming-platform-web
|
|
spec:
|
|
restartPolicy: Always
|
|
initContainers:
|
|
- name: wait-jobmanager
|
|
image: busybox:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
set -ex
|
|
until nc -zv flink-jobmanager 8081; do sleep 5; done
|
|
sleep 10
|
|
containers:
|
|
- name: mysql
|
|
image: mysql:8.0.25
|
|
imagePullPolicy: IfNotPresent
|
|
args:
|
|
- --character-set-server=utf8mb4
|
|
- --collation-server=utf8mb4_unicode_ci
|
|
ports:
|
|
- containerPort: 3306
|
|
# livenessProbe:
|
|
# tcpSocket:
|
|
# port: 3306
|
|
# failureThreshold: 10
|
|
# periodSeconds: 60
|
|
# initialDelaySeconds: 10
|
|
env:
|
|
- name: TZ
|
|
value: Asia/Shanghai
|
|
- name: MYSQL_ROOT_PASSWORD
|
|
value: UWWDEEH8BZ0gUAX
|
|
- name: MYSQL_DATABASE
|
|
value: flink_web
|
|
- name: MYSQL_USER
|
|
value: flink_web_test
|
|
- name: MYSQL_PASSWORD
|
|
value: flink_web_test_123
|
|
volumeMounts:
|
|
- mountPath: /var/lib/mysql
|
|
name: flink-streaming-platform-web-mysql
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
ephemeral-storage: 1Gi
|
|
limits:
|
|
cpu: 5000m
|
|
memory: 5000Mi
|
|
ephemeral-storage: 10Gi
|
|
- name: flink-streaming-platform-web
|
|
image: tanshilindocker/flink-streaming-platform-web:0.0.5
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8080
|
|
# command:
|
|
# - sh
|
|
# - -c
|
|
# - "sleep 99999"
|
|
# livenessProbe:
|
|
# tcpSocket:
|
|
# port: 8000
|
|
# failureThreshold: 10
|
|
# periodSeconds: 60
|
|
# initialDelaySeconds: 10
|
|
args:
|
|
- -Xmx1888M -Xms1888M -Xmn1536M -XX:MaxMetaspaceSize=512M -XX:MetaspaceSize=512M -XX:+UseConcMarkSweepGC -Xdebug -Xrunjdwp:transport=dt_socket,address=9901,server=y,suspend=n -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:ErrorFile=../logs/hs_err_pid%p.log -XX:HeapDumpPath=../logs -XX:+HeapDumpOnOutOfMemoryError
|
|
- --server.port=8080
|
|
- --spring.datasource.url=jdbc:mysql://127.0.0.1:3306/flink_web?characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
|
|
- --spring.datasource.username=flink_web_test
|
|
- --spring.datasource.password=flink_web_test_123
|
|
- --logging.config=classpath:logging/logback-prod.xml
|
|
- --spring.devtools.livereload.enabled=false
|
|
env:
|
|
- name: TZ
|
|
value: Asia/Shanghai
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
ephemeral-storage: 1Gi
|
|
limits:
|
|
cpu: 5000m
|
|
memory: 5000Mi
|
|
ephemeral-storage: 10Gi
|
|
volumeMounts:
|
|
- name: flink-config-volume
|
|
mountPath: /opt/flink/conf
|
|
- mountPath: /app/flink-streaming-platform-web/logs
|
|
name: logs-dir
|
|
# - mountPath: /app/flink-streaming-platform-web/conf
|
|
# name: flink-streaming-platform-web
|
|
- name: promtail
|
|
image: grafana/promtail:2.2.1
|
|
imagePullPolicy: IfNotPresent
|
|
args:
|
|
- -config.file=/etc/promtail/config.yaml
|
|
- -config.expand-env=true
|
|
env:
|
|
- name: TZ
|
|
value: Asia/Shanghai
|
|
- name: ENVIRONMENT_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: REPLICASET_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.labels['app']
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
volumeMounts:
|
|
- mountPath: /mnt
|
|
name: logs-dir
|
|
- mountPath: /etc/promtail
|
|
name: promtail-config
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 0.05Gi
|
|
ephemeral-storage: 1Gi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 0.5Gi
|
|
ephemeral-storage: 10Gi
|
|
volumes:
|
|
- name: flink-streaming-platform-web-mysql
|
|
persistentVolumeClaim:
|
|
claimName: flink-streaming-platform-web-mysql
|
|
# - name: flink-streaming-platform-web
|
|
# configMap:
|
|
# name: flink-streaming-platform-web
|
|
- name: flink-config-volume
|
|
configMap:
|
|
name: flink-config
|
|
items:
|
|
- key: flink-conf.yaml
|
|
path: flink-conf.yaml
|
|
- key: log4j-console.properties
|
|
path: log4j-console.properties
|
|
- name: promtail-config
|
|
configMap:
|
|
name: loki-promtail
|
|
- name: logs-dir
|
|
emptyDir: {} |