Changes

Jump to navigation Jump to search
Created page with "== Requirements == * A working connection and login to the Kubernetes cluster. * A valid namespace selected with authorization to run pods. * A test container pushed to the C..."
== Requirements ==

* A working connection and login to the Kubernetes cluster.
* A valid namespace selected with authorization to run pods.
* A test container pushed to the CCU docker registry.


== Set up a Kubernetes job script ==

Download the [File:Kubernetes samples|Kubernetes samples] and look at job script in example_1. Alternatively, create your own directory and file named "job_script.yaml". Edit the contents as follows and replace all placeholders with your data:

<syntaxhighlight lang="yaml">
</syntaxhighlight>

When we start this job, it will create a single container based on the image we previously uploaded to the registry on a suitable node which serves the selected namespace of the cluster.

<syntaxhighlight lang="yaml">
> kubectl apply -f job_script.yaml
</syntaxhighlight>


== Checking in on the container ==

We first check if our container is running.

<syntaxhighlight lang="bash">
> kubectl get pods
# somewhere in the output you should see a line like this:

</syntaxhighlight>

Now that you now the name of the pod, you can check in on the logs:

<syntaxhighlight lang="bash">
# replace xxxx with the code from get pods.
> kubectl logs tf-mnist-xxxx
</syntaxhighlight>

or get some more information about the node the pod was placed on etc.

<syntaxhighlight lang="bash">
# replace xxxx with the code from get pods.
> kubectl describe pod tf-mnist-xxxx
</syntaxhighlight>

Navigation menu