Skip to content

Jobs with dots in their name prevent the Chart to be installed in VMware Clusters

Summary

There are some jobs that have '.' in their name which is not allowed according to Kubernetes documentation. For instance, the ones related to shared-secrets, migrations and minio-create-buckets.

Surprisingly, there are no problems using implementations like minikube where pods are successfully created but when using a VMware TKGI cluster, pods can't start providing the following messages in kubectl describe pod <>:

  Warning  FailedCreatePodSandBox  30s    kubelet, 446066ca-1e82-4df4-99bc-7978e93bd04c  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "e78a95e9a07c068ad753
  ef39f5b402294000353dd60529cbbddcbbd8412846d7" network for pod "gitlab-release-shared-secrets.1-0j6-24cf9": networkPlugin cni failed to set up pod "gitlab-release-shared-secrets.1-0j6-24cf9_ns-test-gitlab
  " network: netplugin failed with no error message
  Normal   SandboxChanged          29s    kubelet, 446066ca-1e82-4df4-99bc-7978e93bd04c  Pod sandbox changed, it will be killed and re-created.

I find out that when modifying _helpers.tpl files for these jobs and replacing "%s.%d" to "%s-%d" in jobnames, everything works fine. I would like to propose a MR with these changes.

In a less relevant note, I found out that minikube seems to be inconsistent. Jobs can create pods with '.' in their names but if I try to create a pod (using kubectl run ...) I receive an error saying:

The Deployment "devtest.1" is invalid: spec.template.spec.containers[0].name: Invalid value: "devtest.1": 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])?')

Steps to reproduce

Installing the helm chart in a VMware cluster.

helm install gitlab-release gitlab/gitlab --set certmanager-issuer.email=me@example.com

Configuration used

It can be reproduced even using default configuration.

Current behavior

Pods created from jobs with dots in their name stay in ContainerCreating/Init status and won't start.

Expected behavior

Chart installation is possible in VMware (and consistent with other implementations).

Versions

  • Chart: 4.3.4
  • Platform:
    • Cloud: VMware
    • Self-hosted: Minikube v1.12.3
  • Kubernetes: (kubectl version)

For VMware:

  • Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"windows/amd64"}
  • Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.8+vmware.1", GitCommit:"3cbbcf0977af5f3cf455115d060b081f2b8e2329", GitTreeState:"clean", BuildDate:"2020-06-29T22:33:24Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

For Minikube:

  • Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"windows/amd64"}

  • Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

  • Helm: (helm version)

    • version.BuildInfo{Version:"v3.3.0", GitCommit:"8a4aeec08d67a7b84472007529e8097ec3742105", GitTreeState:"dirty", GoVersion:"go1.14.7"}

Relevant logs

root@devtest:/# kubectl describe pod gitlab-release-minio-create-buckets.1-m2bdz

Name:           gitlab-release-minio-create-buckets.1-m2bdz
Namespace:      sf-test-gitlab-jo
Priority:       0
Node:           446066ca-1e82-4df4-99bc-7978e93bd04c/10.210.1.5
Start Time:     Thu, 03 Sep 2020 15:31:47 +0200
Labels:         app=minio
                component=create-buckets
                controller-uid=b4c5b1ae-3050-4678-892b-099429d06a54
                job-name=gitlab-release-minio-create-buckets.1
                release=gitlab-release
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  Job/gitlab-release-minio-create-buckets.1
Containers:
  minio-mc:
    Container ID:
    Image:         minio/mc:RELEASE.2018-07-13T00-53-22Z
    Image ID:
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/sh
      /config/initialize
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Requests:
      cpu:  50m
    Environment:
      MINIO_ENDPOINT:  gitlab-release-minio-svc
      MINIO_PORT:      9000
    Mounts:
      /config from minio-configuration (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-bgsdb (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  minio-configuration:
    Type:                Projected (a volume that contains injected data from multiple sources)
    ConfigMapName:       gitlab-release-minio-config-cm
    ConfigMapOptional:   <nil>
    SecretName:          gitlab-release-minio-secret
    SecretOptionalName:  <nil>
  default-token-bgsdb:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-bgsdb
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age                   From                                           Message
  ----     ------                  ----                  ----                                           -------
  Warning  FailedCreatePodSandBox  6m13s (x25 over 95m)  kubelet, 446066ca-1e82-4df4-99bc-7978e93bd04c  (combined from similar events): Failed to
create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "b17a073837467872a785b81920d592375f3278e443bae22c019d41db0
cb7d050" network for pod "gitlab-release-minio-create-buckets.1-m2bdz": networkPlugin cni failed to set up pod "gitlab-release-minio-create-bucket
s.1-m2bdz_sf-test-gitlab-jo" network: netplugin failed with no error message