<p>I created a deployment with liveness and readiness probes and initial delay which works fine. If I want to replace the initial delay with a startup probe the <code>startupProbe</code> key and its nested elements are never included in the deployment descrioptor when created with <code>kubectl apply</code> and get deleted from the deployment yaml in the GKE deployment editor after saving.</p>

<p>An example:</p>

<pre><code>apiVersion: v1
kind: Namespace
metadata:
  name: "test"
---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres-sleep
  namespace: test
spec:
  selector:
    matchLabels:
      app: postgres-sleep
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 50%
  template:
    metadata:
      labels:
        app: postgres-sleep
    spec:
      containers:
        - name: postgres-sleep
          image: krichter/microk8s-startup-probe-ignored:latest
          ports:
            - name: postgres
              containerPort: 5432
          readinessProbe:
            tcpSocket:
              port: 5432
            periodSeconds: 3
          livenessProbe:
            tcpSocket:
              port: 5432
            periodSeconds: 3
          startupProbe:
            tcpSocket:
              port: 5432
            failureThreshold: 60
            periodSeconds: 10
---

apiVersion: v1
kind: Service
metadata:
  name: postgres-sleep
  namespace: test
spec:
  selector:
    app: httpd
  ports:
    - protocol: TCP
      port: 5432
      targetPort: 5432
---
</code></pre>

<p>with <code>krichter/microk8s-startup-probe-ignored:latest</code> being</p>

<pre><code>FROM postgres:11
CMD sleep 30 &amp;&amp; postgres
</code></pre>

<p>I'm reusing this example from the same issue with microk8s where I could solve it by changing the <code>kubelet</code> and <code>kubeapi-server</code> configuration files (see <a href="https://github.com/ubuntu/microk8s/issues/770" rel="nofollow noreferrer">https://github.com/ubuntu/microk8s/issues/770</a> in case you're interested). I assume this is not possible with GKE clusters as they don't expose these files, probably for good reasons.</p>

<p>I assume that the feature needs to be enable since it's behind a feature gate. How can I enable it on Google Kubernetes Engine (GKE) clusters with version >= 1.16? Currently I'm using the default from the regular channel 1.16.8-gke.15.</p>

<p>As I mentioned in my comments, I was able to reproduce the same behavior in my test environment, and after some researches I found the reason.</p>

<p>In GKE, features gates are only permitted if you are using an Alpha Cluster. You can see a complete list of feature gates <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features" rel="noreferrer">here</a></p>

<p>I've created an alpha cluster and applied the same yaml, it works for me, the <code>startupProbe</code> is there in the place.</p>

<p>So, you will only be able to use <code>startupProbe</code> in a GKE Alpha clusters, follow this <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/creating-an-alpha-cluster" rel="noreferrer">documentation</a> to create a new one.</p>

<p><strong>Be aware of the limitations in alpha clusters:</strong></p>

<blockquote>
  <ul>
  <li>Alpha clusters have the following limitations:</li>
  <li>Not covered by the  <a href="https://cloud.google.com/kubernetes-engine/sla" rel="noreferrer">GKE SLA</a></li>
  <li>Cannot be upgraded</li>
  <li>Node auto-upgrade and auto-repair are disabled on alpha clusters</li>
  <li><strong>Automatically deleted after 30 days</strong></li>
  <li>Do not receive security updates</li>
  </ul>
</blockquote>

<p>Also, Google don't recommend use for production workloads:</p>

<blockquote>
  <p><strong>Warning:</strong> Do not use Alpha clusters or alpha features for production workloads. Alpha clusters expire after thirty days and do not receive security updates. You must migrate your data from alpha clusters before they expire. GKE does not automatically save data stored on alpha clusters.</p>
</blockquote>
