apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpserver-deployment
  labels:
    app: httpserver
  namespace: httpserver
spec:
  replicas: 3
  selector:
    matchLabels:
      app: httpserver
  template:
    metadata:
      labels:
        app: httpserver
    spec:
      containers:
        - name: httpserver
          image: wangqifox/httpserver:v2
          env:
            - name: VERSION
              valueFrom:
                configMapKeyRef:
                  name: httpserver-config
                  key: version
          ports:
            - containerPort: 80
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
            requests:
              memory: "128Mi"
              cpu: "1000m"
            limits:
              memory: "128Mi"
              cpu: "1000m"