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
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐