I have just setup a Kubernetes/docker cluster with 2 nodes, and I would like to deploy a test image for now, I would like to try with the folding@home project.
I found the docker image in https://hub.docker.com/r/captinsano/foldingathome but I can't figure out how to load that image into K8s. I know I need to generate a yaml file but I am not sure how to proceed from there. I tried to create a yaml file with the following:
apiVersion: v1
kind: Pod
metadata:
name: foldingAtHome
spec:
containers:
- name: foldingAtHome-container01
image: captinsano/foldingathome:latest
ports:
- containerPort: 6379
But K8s complains about the way I referenced values in the yaml file.
kubectl create -f foldingAtHome.yml
The Pod "foldingAtHome" is invalid:
* metadata.name: Invalid value: "foldingAtHome": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
* spec.containers[0].name: Invalid value: "foldingAtHome-container01": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
I am not sure what I am doing wrong ? how do I get Kubernetes to tell docker to pull that image?
Thank you
Its already there what you have done wrong. Use the small letters instead in both metadata and container name.
Kubernetes doesn't allow capital case in meta data, because this will be used by core DNS component of kubernetes as a DNS of your service. Change the name to lower case and it should work fine.
According to the error messages:
* metadata.name: Invalid value: "foldingAtHome": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
* spec.containers[0].name: Invalid value: "foldingAtHome-container01": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
There are clues to the error occurred:
* metadata.name: Invalid value: "foldingAtHome"
only support lower case letters, which is line 4 of your YAML file.* spec.containers[0].name: Invalid value: "foldingAtHome-container01"
also only support lower case characters, which is line 7 of your YAML file.Change them to lower case should be okay.