Bug 1613677 - Can not use gitrepo volume on OCP 3.11 as there are no git cmd on node host
Summary: Can not use gitrepo volume on OCP 3.11 as there are no git cmd on node host
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.11.z
Assignee: Lindsey Barbee-Vargas
QA Contact: Qin Ping
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-08 06:59 UTC by Liang Xia
Modified: 2020-05-14 20:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-14 20:59:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Liang Xia 2018-08-08 06:59:24 UTC
Description of problem:
Can not use gitrepo volume on atomic host as there are no git cmd

Version-Release number of selected component (if applicable):
oc v3.11.0-0.11.0
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO


How reproducible:
Always

Steps to Reproduce:
1. Setup OCP cluster on atomic host.
2. Create a pod with gitrepo volume.
3. Check the pod.
$ oc describe pod gitrepo

Actual results:
Events:
  Type     Reason       Age               From                                   Message
  ----     ------       ----              ----                                   -------
  Normal   Scheduled    16s               default-scheduler                      Successfully assigned default/gitrepo to ip-172-18-8-135.ec2.internal
  Warning  FailedMount  8s (x5 over 16s)  kubelet, ip-172-18-8-135.ec2.internal  MountVolume.SetUp failed for volume "gitrepo" : failed to exec 'git clone -- https://github.com/jhou1/gitrepoVolume.git': : executable file not found in $PATH


Expected results:
Pod should be running.


Additional info:
[root@ip-172-18-8-135 ~]# which git
/usr/bin/which: no git in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/.local/bin:/root/bin)

[root@ip-172-18-8-135 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Atomic Host release 7.5

[root@ip-172-18-8-135 ~]# uname -a
Linux ip-172-18-8-135.ec2.internal 3.10.0-862.6.3.el7.x86_64 #1 SMP Fri Jun 15 17:57:37 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

# cat pod.yaml 
{
  "kind": "Pod",
  "apiVersion": "v1",
  "metadata": {
    "name": "gitrepo",
    "creationTimestamp": null,
    "labels": {
      "name": "volume-test"
    }
  },
  "spec": {
    "containers": [
      {
        "name": "c1",
        "image": "jhou/hello-openshift",
        "ports": [
          {
            "containerPort": 8080,
            "protocol": "TCP"
          }
        ],
        "resources": {},
        "volumeMounts": [
          {
            "name":"gitrepo",
            "mountPath":"/mnt/git"
          }
        ],
        "terminationMessagePath": "/dev/termination-log",
        "imagePullPolicy": "IfNotPresent",
        "securityContext": {
          "privileged": false
        }
      }
    ],
    "volumes": [
      {
        "name":"gitrepo",
        "gitRepo": {
            "repository": "https://github.com/jhou1/gitrepoVolume.git",
            "revision": "5ead1a2fba0bd6af433beb8064ef4493b63e368c"
        }
      }
    ],
    "restartPolicy": "Always",
    "dnsPolicy": "ClusterFirst",
    "serviceAccount": ""
  },
  "status": {}
}

Comment 1 Liang Xia 2018-08-10 05:52:57 UTC
Also met this on a RHEL7 cluster,

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.4 (Maipo)

# uname -a
Linux qe-lxia-master-etcd-1 3.10.0-693.21.1.el7.x86_64 #1 SMP Fri Feb 23 18:54:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Comment 4 Seth Jennings 2018-08-20 18:05:27 UTC
Origin PR:
https://github.com/openshift/origin/pull/20698

Comment 5 Seth Jennings 2018-08-20 20:01:55 UTC
gitrepo volumes are not supported
https://github.com/openshift/origin/pull/20698#issuecomment-414414946

Sending to docs team to note that we do not support this volume type.

QE can remove tests for this.

Comment 7 Lindsey Barbee-Vargas 2020-05-13 20:17:54 UTC
Made changes as described: Removed `gitRepo` example from Managing Volumes. Also removed all `gitRepo` objects from Rest APIs (found under `volumes`). This can be reviewed here: https://github.com/openshift/openshift-docs/pull/22073. Moving this bug to ON_QA.

Comment 8 Lindsey Barbee-Vargas 2020-05-14 20:59:54 UTC
Verified fix is published and live on docs.openshift.com:
https://docs.openshift.com/container-platform/3.11/dev_guide/volumes.html#listing-volumes
https://docs.openshift.com/container-platform/3.11/admin_guide/manage_scc.html
https://docs.openshift.com/container-platform/3.11/architecture/additional_concepts/authorization.html
https://docs.openshift.com/container-platform/3.11/install_config/persistent_storage/pod_security_context.html

(Removed `gitRepo` from the following Rest API Object Schemas)
https://docs.openshift.com/container-platform/3.11/rest_api/api/v1.Pod.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/api/v1.PodTemplate.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/api/v1.ReplicationController.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-apps.openshift.io/v1.DeploymentConfig.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-apps/v1beta1.Deployment.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-apps/v1beta1.StatefulSet.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-batch/v1.Job.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-batch/v2alpha1.CronJob.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-batch/v2alpha1.ScheduledJob.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-extensions/v1beta1.DaemonSet.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-extensions/v1beta1.Deployment.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-extensions/v1beta1.ReplicaSet.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-security.openshift.io/v1.PodSecurityPolicyReview.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-security.openshift.io/v1.PodSecurityPolicySelfSubjectReview.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/apis-security.openshift.io/v1.PodSecurityPolicySubjectReview.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/oapi/v1.DeploymentConfig.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/oapi/v1.PodSecurityPolicyReview.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/oapi/v1.PodSecurityPolicySelfSubjectReview.html#object-schema
https://docs.openshift.com/container-platform/3.11/rest_api/oapi/v1.PodSecurityPolicySubjectReview.html#object-schema


Note You need to log in before you can comment on or make changes to this bug.