<p dir="auto">I use /hack/local-up-cluster to start a local k8s. And operate like below:</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="./cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80
CONTROLLER   CONTAINER(S)   IMAGE(S)   SELECTOR       REPLICAS   AGE
my-nginx     my-nginx       nginx      run=my-nginx   2          0s"><pre class="notranslate"><span class="pl-c1">./cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80</span>
<span class="pl-c1">CONTROLLER   CONTAINER(S)   IMAGE(S)   SELECTOR       REPLICAS   AGE</span>
<span class="pl-c1">my-nginx     my-nginx       nginx      run=my-nginx   2          0s</span></pre></div>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="./cluster/kubectl.sh get pods --watch"><pre class="notranslate"><span class="pl-c1">./cluster/kubectl.sh get pods --watch</span></pre></div>
<p dir="auto">Then I use "docker kill " to kill one container of rc for thrice. Here is result:</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="./cluster/kubectl.sh get pods --watch
NAME             READY     STATUS    RESTARTS   AGE
my-nginx-kn1zy   0/1       Running   0          6s
my-nginx-msjcr   1/1       Running   0          6s
NAME             READY     STATUS    RESTARTS   AGE
my-nginx-kn1zy   1/1       Running   0          10s
my-nginx-kn1zy   0/1       Running   1         51s
my-nginx-kn1zy   1/1       Running   1         1m
my-nginx-kn1zy   0/1       Running   2         1m
my-nginx-kn1zy   1/1       Running   2         1m
my-nginx-kn1zy   0/1       Running   3         3m
my-nginx-kn1zy   1/1       Running   3         3m
my-nginx-kn1zy   1/1       Running   2         4m"><pre class="notranslate"><span class="pl-c1">./cluster/kubectl.sh get pods --watch</span>
<span class="pl-c1">NAME             READY     STATUS    RESTARTS   AGE</span>
<span class="pl-c1">my-nginx-kn1zy   0/1       Running   0          6s</span>
<span class="pl-c1">my-nginx-msjcr   1/1       Running   0          6s</span>
<span class="pl-c1">NAME             READY     STATUS    RESTARTS   AGE</span>
<span class="pl-c1">my-nginx-kn1zy   1/1       Running   0          10s</span>
<span class="pl-c1">my-nginx-kn1zy   0/1       Running   1         51s</span>
<span class="pl-c1">my-nginx-kn1zy   1/1       Running   1         1m</span>
<span class="pl-c1">my-nginx-kn1zy   0/1       Running   2         1m</span>
<span class="pl-c1">my-nginx-kn1zy   1/1       Running   2         1m</span>
<span class="pl-c1">my-nginx-kn1zy   0/1       Running   3         3m</span>
<span class="pl-c1">my-nginx-kn1zy   1/1       Running   3         3m</span>
<span class="pl-c1">my-nginx-kn1zy   1/1       Running   2         4m</span></pre></div>
<p dir="auto">The "RESTARTS" is supposed to be 3. But it will be changed to 2 at last . Is there reason which will cause RESTARTS reduce?</p>
<p dir="auto">A new Pod with HTTP Health Check probe is created as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: v1
kind: Pod
metadata:
  name: wildfly-pod
  labels: 
    name: wildfly
spec: 
  containers: 
    - image: jboss/wildfly
      name: wildfly-pod
      livenessProbe:
        # an http probe
        httpGet:
          path: /index.html
          port: 8080
        httpGet:
          path: /movieplex7
          port: 8080
        # length of time to wait for a pod to initialize
        # after pod startup, before applying health checking
        initialDelaySeconds: 30
        timeoutSeconds: 1
      ports: 
        - containerPort: 8080"><pre class="notranslate"><code class="notranslate">apiVersion: v1
kind: Pod
metadata:
  name: wildfly-pod
  labels: 
    name: wildfly
spec: 
  containers: 
    - image: jboss/wildfly
      name: wildfly-pod
      livenessProbe:
        # an http probe
        httpGet:
          path: /index.html
          port: 8080
        httpGet:
          path: /movieplex7
          port: 8080
        # length of time to wait for a pod to initialize
        # after pod startup, before applying health checking
        initialDelaySeconds: 30
        timeoutSeconds: 1
      ports: 
        - containerPort: 8080
</code></pre></div>
<p dir="auto">This one works correctly. If the path of second probe is changed to <code class="notranslate">/movieplex</code> then status of created Pod is shown as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubernetes-1.0.1&gt; ./cluster/kubectl.sh get -w po
NAME      READY     STATUS    RESTARTS   AGE
NAME          READY     STATUS    RESTARTS   AGE
wildfly-pod   0/1       Pending   0          0s
wildfly-pod   0/1       Pending   0         0s
wildfly-pod   0/1       Pending   0         0s
wildfly-pod   0/1       Running   0         2s
wildfly-pod   1/1       Running   0         10s
wildfly-pod   0/1       Running   1         51s
wildfly-pod   1/1       Running   1         52s
wildfly-pod   0/1       Running   2         1m
wildfly-pod   1/1       Running   2         1m
wildfly-pod   0/1       Running   3         2m
wildfly-pod   1/1       Running   3         2m
wildfly-pod   0/1       Running   3         3m
wildfly-pod   1/1       Running   3         3m
wildfly-pod   0/1       Running   4         4m
wildfly-pod   1/1       Running   4         4m
wildfly-pod   1/1       Running   3         4m
wildfly-pod   0/1       Running   4         5m
wildfly-pod   1/1       Running   4         5m
wildfly-pod   1/1       Running   2         5m
wildfly-pod   0/1       Running   3         5m
wildfly-pod   1/1       Running   3         5m
wildfly-pod   0/1       Running   3         6m
wildfly-pod   1/1       Running   3         6m
wildfly-pod   0/1       Running   4         7m
wildfly-pod   1/1       Running   4         7m
wildfly-pod   1/1       Running   3         7m
wildfly-pod   0/1       Running   4         7m
wildfly-pod   1/1       Running   4         7m
wildfly-pod   0/1       Running   3         8m
wildfly-pod   1/1       Running   3         8m
wildfly-pod   0/1       Running   4         9m
wildfly-pod   1/1       Running   4         9m
wildfly-pod   1/1       Running   3         9m
wildfly-pod   0/1       Running   4         9m
wildfly-pod   1/1       Running   4         9m
wildfly-pod   0/1       Running   3         10m
wildfly-pod   1/1       Running   3         10m
wildfly-pod   0/1       Running   4         11m
wildfly-pod   1/1       Running   4         11m
wildfly-pod   1/1       Running   2         11m
wildfly-pod   0/1       Running   3         11m
wildfly-pod   1/1       Running   3         11m
wildfly-pod   0/1       Running   3         12m
wildfly-pod   1/1       Running   3         12m
wildfly-pod   0/1       Running   3         13m
wildfly-pod   1/1       Running   3         13m
wildfly-pod   0/1       Running   4         14m
wildfly-pod   1/1       Running   4         14m
wildfly-pod   1/1       Running   3         14m
wildfly-pod   0/1       Running   4         15m
wildfly-pod   1/1       Running   4         15m
wildfly-pod   1/1       Running   2         15m
wildfly-pod   0/1       Running   3         16m
wildfly-pod   1/1       Running   3         16m
wildfly-pod   0/1       Running   3         16m
wildfly-pod   1/1       Running   3         16m
wildfly-pod   0/1       Running   3         17m
wildfly-pod   1/1       Running   3         17m
wildfly-pod   0/1       Running   4         18m
wildfly-pod   1/1       Running   4         18m
wildfly-pod   1/1       Running   3         18m
wildfly-pod   0/1       Running   4         19m
wildfly-pod   1/1       Running   4         19m
wildfly-pod   1/1       Running   2         19m"><pre class="notranslate"><code class="notranslate">kubernetes-1.0.1&gt; ./cluster/kubectl.sh get -w po
NAME      READY     STATUS    RESTARTS   AGE
NAME          READY     STATUS    RESTARTS   AGE
wildfly-pod   0/1       Pending   0          0s
wildfly-pod   0/1       Pending   0         0s
wildfly-pod   0/1       Pending   0         0s
wildfly-pod   0/1       Running   0         2s
wildfly-pod   1/1       Running   0         10s
wildfly-pod   0/1       Running   1         51s
wildfly-pod   1/1       Running   1         52s
wildfly-pod   0/1       Running   2         1m
wildfly-pod   1/1       Running   2         1m
wildfly-pod   0/1       Running   3         2m
wildfly-pod   1/1       Running   3         2m
wildfly-pod   0/1       Running   3         3m
wildfly-pod   1/1       Running   3         3m
wildfly-pod   0/1       Running   4         4m
wildfly-pod   1/1       Running   4         4m
wildfly-pod   1/1       Running   3         4m
wildfly-pod   0/1       Running   4         5m
wildfly-pod   1/1       Running   4         5m
wildfly-pod   1/1       Running   2         5m
wildfly-pod   0/1       Running   3         5m
wildfly-pod   1/1       Running   3         5m
wildfly-pod   0/1       Running   3         6m
wildfly-pod   1/1       Running   3         6m
wildfly-pod   0/1       Running   4         7m
wildfly-pod   1/1       Running   4         7m
wildfly-pod   1/1       Running   3         7m
wildfly-pod   0/1       Running   4         7m
wildfly-pod   1/1       Running   4         7m
wildfly-pod   0/1       Running   3         8m
wildfly-pod   1/1       Running   3         8m
wildfly-pod   0/1       Running   4         9m
wildfly-pod   1/1       Running   4         9m
wildfly-pod   1/1       Running   3         9m
wildfly-pod   0/1       Running   4         9m
wildfly-pod   1/1       Running   4         9m
wildfly-pod   0/1       Running   3         10m
wildfly-pod   1/1       Running   3         10m
wildfly-pod   0/1       Running   4         11m
wildfly-pod   1/1       Running   4         11m
wildfly-pod   1/1       Running   2         11m
wildfly-pod   0/1       Running   3         11m
wildfly-pod   1/1       Running   3         11m
wildfly-pod   0/1       Running   3         12m
wildfly-pod   1/1       Running   3         12m
wildfly-pod   0/1       Running   3         13m
wildfly-pod   1/1       Running   3         13m
wildfly-pod   0/1       Running   4         14m
wildfly-pod   1/1       Running   4         14m
wildfly-pod   1/1       Running   3         14m
wildfly-pod   0/1       Running   4         15m
wildfly-pod   1/1       Running   4         15m
wildfly-pod   1/1       Running   2         15m
wildfly-pod   0/1       Running   3         16m
wildfly-pod   1/1       Running   3         16m
wildfly-pod   0/1       Running   3         16m
wildfly-pod   1/1       Running   3         16m
wildfly-pod   0/1       Running   3         17m
wildfly-pod   1/1       Running   3         17m
wildfly-pod   0/1       Running   4         18m
wildfly-pod   1/1       Running   4         18m
wildfly-pod   1/1       Running   3         18m
wildfly-pod   0/1       Running   4         19m
wildfly-pod   1/1       Running   4         19m
wildfly-pod   1/1       Running   2         19m
</code></pre></div>
<p dir="auto">The stats on restarts are not reported correctly because the container should have started multiple times because the probe is failing. The number of restarts should increase by 1 every time it is restarted.</p>