Kubernetes CronJob

7/7/2017

I am trying to run the Cron Job example provided on the Kubernetes web site. It says the prerequisites are Kubernetes cluster version >=1.5 (I am currently on 1.6.6) and batch/v2alpha1 API turned on.

The document mentioned that we need to pass "--runtime-config=batch/v2alpha1=true" argument while bringing up the API server to turn on the batch/v2alpha1 API, but it does not mention how exactly to do that. The link given for Turn on or off an API version for your cluster does not mention detailed procedures neither.

I am quite confused on where should I pass the "--runtime-config=batch/v2alpha1=true" argument, and how exactly should I do that. I saw in some places mentioned that we could download kube-apiserver file, but I tired to run it without success, and I was quite confused about what kind of argument should I pass.

As mentioned above I am using a 1.6.6 kubernetes cluster, and I am running it on Google Cloud Platform.

Thanks for the clarification.

-- CLD
cron
gcp
kubernetes

2 Answers

7/7/2017

on the master server api configuration stored in this location /etc/kubernetes/manifests/kube-apiserver.yaml.

  1. take the backup of this file.
  2. add the new argument in command: section.
  3. restart the node, it will start with new argument.
-- sfgroups
Source: StackOverflow

12/3/2017

For GCP, the api version you're looking for is only enabled by default starting in 1.8. You'll find a note to that effect here:

You could spin up an alpha cluster if you wanted to stick with an earlier major version of the api but with the beta api available. Those alpha clusters are deleted after 30 days, so it may not be what you want.

Instead, if you want to upgrade to 1.8, try these steps:

View the available versions:

$ gcloud container get-server-config --zone=<YOUR ZONE>

Get your cluster name:

$ gcloud container clusters list

Then upgrade your cluster:

$ gcloud container clusters upgrade <CLUSTER_NAME> --master --cluster-version=<CLUSTER_VERSION>
$ gcloud container clusters upgrade <CLUSTER_NAME> --cluster-version=<CLUSTER_VERSION>

Hope that helps.

-- stackedsax
Source: StackOverflow