---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
app: demo
name: demo
namespace: env
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app: demo
version: v1
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: demo
version: v1
spec:
containers:
- args:
- java
- '-server'
- '-Xms64M'
- '-Xmx256M'
- '-Xss256K'
- '-XX:+UseG1GC'
- '-Dfile.encoding=UTF-8'
- '-Dspring.config.location=./config/bootstrap.yml'
- '-DSW_AGENT_COLLECTOR_BACKEND_SERVICES=IP:PORT'
- '-DSW_KAFKA_BOOTSTRAP_SERVERS=IP:PORT'
- '-javaagent:/opt/agent/skywalking/skywalking-agent.jar'
- '-jar'
- /opt/demo.jar
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: HOST_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.hostIP
- name: APP_NAME
value: demo
- name: SW_AGENT_NAME
value: demo
- name: SW_LOGGING_LEVEL
value: ERROR
image: >-
image/demo:version
imagePullPolicy: IfNotPresent
name: demo
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/config/
name: config-volume
- mountPath: /opt/agent
name: plugins
- mountPath: /opt/agent/skywalking/config/agent.config
name: volume-py2n3
subPath: agent.config
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: secret
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
name: project-name
name: config-volume
- name: plugins
persistentVolumeClaim:
claimName: plugins-skywalking
- configMap:
defaultMode: 420
name: xiot-skywalking
name: volume-py2n3
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: demo
name: demo
namespace: env
spec:
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: http-pffzgm
port: 8080
protocol: TCP
targetPort: 8080
- name: tcp-z5s2sh
port: 18080
protocol: TCP
targetPort: 18080
selector:
app: demo
version: v1
sessionAffinity: None
type: ClusterIP
【运维架构】Kubenetes Deployment模板
于 2023-03-20 14:07:34 首次发布