k8s部署java服务yaml
k8s.yamlkind: ServiceapiVersion: v1metadata:name: <PROJECT_NAME>namespace: <SPACE>spec:selector:app: <PROJECT_NAME>type: ClusterIPports:- protocol: TCPport: 80targetPort: 8080---apiV
·
k8s.yaml
kind: Service
apiVersion: v1
metadata:
name: <PROJECT_NAME>
namespace: <SPACE>
spec:
selector:
app: <PROJECT_NAME>
type: ClusterIP
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: <PROJECT_NAME>
namespace: <SPACE>
labels:
app: <PROJECT_NAME>
spec:
replicas: 1
selector:
matchLabels:
app: <PROJECT_NAME>
template:
metadata:
labels:
app: <PROJECT_NAME>
spec:
imagePullSecrets:
- name: pipeline-docker-registry
containers:
- name: <PROJECT_NAME>
image: hub.myapp.com/<GROUP_ID>/<PROJECT_NAME>:<BUILD_TAG>
ports:
- containerPort: 8080
env:
- name: config_profile
valueFrom:
configMapKeyRef:
name: spring-active
key: config_profile
- name: JAVA_OPTS
value: -javaagent:/agent/skywalking-agent.jar
-Dskywalking.agent.service_name=<PROJECT_NAME>
-Dskywalking.collector.backend_service=skywalking-oap.oap:11800
更多推荐
已为社区贡献11条内容
所有评论(0)