apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-kubernetes-hello-kubernetes
  labels:
    app.kubernetes.io/name: hello-kubernetes
    app.kubernetes.io/instance: hello-kubernetes
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: hello-kubernetes
      app.kubernetes.io/instance: hello-kubernetes
  template:
    metadata:
      labels:
        app.kubernetes.io/name: hello-kubernetes
        app.kubernetes.io/instance: hello-kubernetes
    spec:
      serviceAccountName: hello-kubernetes-hello-kubernetes
      containers:
        - name: hello-kubernetes
          image: "mluyo3414/hello-kubernetes:1.10"
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          env:
          - name: KUBERNETES_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: KUBERNETES_POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: KUBERNETES_NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: CONTAINER_IMAGE
            value: "mluyo3414/hello-kubernetes:1.10"
      nodeSelector:
        kubernetes.io/arch: amd64
        kubernetes.io/os: linux