apiVersion: apps/v1 kind: Deployment metadata: labels: app: iot-box-websocket-api name: iot-box-websocket-api namespace: qiuguo-iot #一定要写名称空间 spec: progressDeadlineSeconds: 600 replicas: 1 selector: matchLabels: app: iot-box-websocket-api strategy: rollingUpdate: maxSurge: 50% maxUnavailable: 50% type: RollingUpdate template: metadata: labels: app: iot-box-websocket-api spec: imagePullSecrets: - name: aliyun-hub-register #提前在项目下配置访问阿里云的账号密码 containers: - image: $REGISTRY/$DOCKERHUB_NAMESPACE/qiuguo-iot:iot-box-websocket-api-SNAPSHOT-v$BUILD_NUMBER readinessProbe: httpGet: path: /actuator/health port: 8080 timeoutSeconds: 30 failureThreshold: 120 periodSeconds: 15 imagePullPolicy: Always name: app ports: - containerPort: 8080 protocol: TCP resources: limits: cpu: 100m memory: 600Mi terminationMessagePath: /nfs/data/qiuguo/iot/logs terminationMessagePolicy: File dnsPolicy: ClusterFirst restartPolicy: Always terminationGracePeriodSeconds: 120 --- apiVersion: v1 kind: Service metadata: labels: app: iot-box-websocket-api name: iot-box-websocket-api namespace: qiuguo-iot spec: ports: - name: http port: 8080 protocol: TCP targetPort: 8080 selector: app: iot-box-websocket-api sessionAffinity: None type: ClusterIP