---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: user
  labels:
    name: user
    app: user
  namespace: sock-shop
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user
  template:
    metadata:
      labels:
        name: user
        app: user
        version: v1
    spec:
      containers:
      - name: user
        image: sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/user:v0.1.5
        #image: weaveworksdemos/user:0.4.7
        resources:
          limits:
            cpu: 300m
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 80
        env:
        - name: mongo
          value: user-db:27017
        - name: OTLP_ENDPOINT
          value: opentelemetry-collector.opentelemetry-collector:55680
        securityContext:
          runAsNonRoot: true
          runAsUser: 10001
          capabilities:
            drop:
              - all
            add:
              - NET_BIND_SERVICE
          readOnlyRootFilesystem: true
        livenessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 300
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 180
          periodSeconds: 30
      nodeSelector:
        beta.kubernetes.io/os: linux
