Bug 1275001
Summary: | With project request template with quota/limit range, error creating new projects (although project successfully created) | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Erik M Jacobs <ejacobs> |
Component: | Node | Assignee: | David Eads <deads> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jianwei Hou <jhou> |
Severity: | urgent | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.1.0 | CC: | aos-bugs, ejacobs, jliggitt, jokerman, mmccomas, sdodson |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-23 14:43:38 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Erik M Jacobs
2015-10-24 18:43:10 UTC
What does this show? `oc get templates default-project-request -n default -o json --loglevel=8` [root@ose3-master training]# oc get templates default-project-request -n default -o json --loglevel=8 I1027 03:03:14.917911 13053 debugging.go:99] GET https://ose3-master.example.com:8443/oapi I1027 03:03:14.917986 13053 debugging.go:106] Request Headers: I1027 03:03:14.917991 13053 debugging.go:109] User-Agent: oc/v3.0.2.903 (linux/amd64) openshift/49953d6 I1027 03:03:14.981781 13053 debugging.go:124] Response Status: 200 OK in 63 milliseconds I1027 03:03:14.981818 13053 debugging.go:127] Response Headers: I1027 03:03:14.981826 13053 debugging.go:130] Date: Tue, 27 Oct 2015 07:03:14 GMT I1027 03:03:14.981833 13053 debugging.go:130] Content-Length: 32 I1027 03:03:14.981840 13053 debugging.go:130] Cache-Control: no-store I1027 03:03:14.981846 13053 debugging.go:130] Content-Type: application/json I1027 03:03:14.981892 13053 request.go:777] Response Body: { "versions": [ "v1" ] } I1027 03:03:14.985450 13053 debugging.go:99] GET https://ose3-master.example.com:8443/api I1027 03:03:14.985465 13053 debugging.go:106] Request Headers: I1027 03:03:14.985469 13053 debugging.go:109] User-Agent: oc/v1.2.0 (linux/amd64) kubernetes/4c8e6f4 I1027 03:03:14.990625 13053 debugging.go:124] Response Status: 200 OK in 5 milliseconds I1027 03:03:14.990660 13053 debugging.go:127] Response Headers: I1027 03:03:14.990669 13053 debugging.go:130] Cache-Control: no-store I1027 03:03:14.990677 13053 debugging.go:130] Content-Type: application/json I1027 03:03:14.990685 13053 debugging.go:130] Date: Tue, 27 Oct 2015 07:03:14 GMT I1027 03:03:14.990696 13053 debugging.go:130] Content-Length: 32 I1027 03:03:14.990724 13053 request.go:777] Response Body: { "versions": [ "v1" ] } I1027 03:03:14.990924 13053 debugging.go:99] GET https://ose3-master.example.com:8443/oapi I1027 03:03:14.990931 13053 debugging.go:106] Request Headers: I1027 03:03:14.990935 13053 debugging.go:109] User-Agent: oc/v3.0.2.903 (linux/amd64) openshift/49953d6 I1027 03:03:14.993647 13053 debugging.go:124] Response Status: 200 OK in 2 milliseconds I1027 03:03:14.993675 13053 debugging.go:127] Response Headers: I1027 03:03:14.993683 13053 debugging.go:130] Cache-Control: no-store I1027 03:03:14.993690 13053 debugging.go:130] Content-Type: application/json I1027 03:03:14.993696 13053 debugging.go:130] Date: Tue, 27 Oct 2015 07:03:14 GMT I1027 03:03:14.993700 13053 debugging.go:130] Content-Length: 32 I1027 03:03:14.993718 13053 request.go:777] Response Body: { "versions": [ "v1" ] } I1027 03:03:14.993917 13053 debugging.go:99] GET https://ose3-master.example.com:8443/oapi/v1/namespaces/default/templates/default-project-request I1027 03:03:14.993926 13053 debugging.go:106] Request Headers: I1027 03:03:14.993930 13053 debugging.go:109] User-Agent: oc/v3.0.2.903 (linux/amd64) openshift/49953d6 I1027 03:03:14.997685 13053 debugging.go:124] Response Status: 200 OK in 3 milliseconds I1027 03:03:14.997711 13053 debugging.go:127] Response Headers: I1027 03:03:14.997719 13053 debugging.go:130] Cache-Control: no-store I1027 03:03:14.997726 13053 debugging.go:130] Content-Type: application/json I1027 03:03:14.997732 13053 debugging.go:130] Date: Tue, 27 Oct 2015 07:03:14 GMT I1027 03:03:14.997761 13053 request.go:777] Response Body: {"kind":"Template","apiVersion":"v1","metadata":{"name":"default-project-request","namespace":"default","selfLink":"/oapi/v1/namespaces/default/templates/default-project-request","uid":"6ef028d6-7c78-11e5-9b45-525400b33d1d","resourceVersion":"540","creationTimestamp":"2015-10-27T07:00:40Z"},"objects":[{"apiVersion":"v1","kind":"Project","metadata":{"annotations":{"openshift.io/description":"${PROJECT_DESCRIPTION}","openshift.io/display-name":"${PROJECT_DISPLAYNAME}"},"creationTimestamp":null,"name":"${PROJECT_NAME}"},"spec":{},"status":{}},{"apiVersion":"v1","kind":"ResourceQuota","metadata":{"name":"${PROJECT_NAME}-quota"},"spec":{"hard":{"cpu":"200m","memory":"512Mi","pods":3,"replicationcontrollers":3,"resourcequotas":1,"services":3}}},{"apiVersion":"v1","kind":"LimitRange","metadata":{"creationTimestamp":null,"name":"${PROJECT_NAME}-limits"},"spec":{"limits":[{"max":{"cpu":"500m","memory":"750Mi"},"min":{"cpu":"10m","memory":"5Mi"},"type":"Pod"},{"default":{"cpu":"100m","memory":"100Mi"},"max":{"cpu":"500m","memory":"750Mi"},"min":{"cpu":"10m","memory":"5Mi"},"type":"Container"}]}},{"apiVersion":"v1","groupNames":[],"kind":"RoleBinding","metadata":{"creationTimestamp":null,"name":"admins","namespace":"${PROJECT_NAME}"},"roleRef":{"name":"admin"},"subjects":[{"kind":"User","name":"${PROJECT_ADMIN_USER}"}],"userNames":["${PROJECT_ADMIN_USER}"]},{"apiVersion":"v1","groupNames":["system:serviceaccounts:${PROJECT_NAME}"],"kind":"RoleBinding","metadata":{"creationTimestamp":null,"name":"system:image-pullers","namespace":"${PROJECT_NAME}"},"roleRef":{"name":"system:image-puller"},"subjects":[{"kind":"SystemGroup","name":"system:serviceaccounts:${PROJECT_NAME}"}],"userNames":[]},{"apiVersion":"v1","groupNames":[],"kind":"RoleBinding","metadata":{"creationTimestamp":null,"name":"system:image-builders","namespace":"${PROJECT_NAME}"},"roleRef":{"name":"system:image-builder"},"subjects":[{"kind":"ServiceAccount","name":"builder"}],"userNames":["system:serviceaccount:${PROJECT_NAME}:builder"]},{"apiVersion":"v1","groupNames":[],"kind":"RoleBinding","metadata":{"creationTimestamp":null,"name":"system:deployers","namespace":"${PROJECT_NAME}"},"roleRef":{"name":"system:deployer"},"subjects":[{"kind":"ServiceAccount","name":"deployer"}],"userNames":["system:serviceaccount:${PROJECT_NAME}:deployer"]}],"parameters":[{"name":"PROJECT_NAME"},{"name":"PROJECT_DISPLAYNAME"},{"name":"PROJECT_DESCRIPTION"},{"name":"PROJECT_ADMIN_USER"}]} { "kind": "Template", "apiVersion": "v1", "metadata": { "name": "default-project-request", "namespace": "default", "selfLink": "/oapi/v1/namespaces/default/templates/default-project-request", "uid": "6ef028d6-7c78-11e5-9b45-525400b33d1d", "resourceVersion": "540", "creationTimestamp": "2015-10-27T07:00:40Z" }, "objects": [ { "apiVersion": "v1", "kind": "Project", "metadata": { "annotations": { "openshift.io/description": "${PROJECT_DESCRIPTION}", "openshift.io/display-name": "${PROJECT_DISPLAYNAME}" }, "creationTimestamp": null, "name": "${PROJECT_NAME}" }, "spec": {}, "status": {} }, { "apiVersion": "v1", "kind": "ResourceQuota", "metadata": { "name": "${PROJECT_NAME}-quota" }, "spec": { "hard": { "cpu": "200m", "memory": "512Mi", "pods": 3, "replicationcontrollers": 3, "resourcequotas": 1, "services": 3 } } }, { "apiVersion": "v1", "kind": "LimitRange", "metadata": { "creationTimestamp": null, "name": "${PROJECT_NAME}-limits" }, "spec": { "limits": [ { "max": { "cpu": "500m", "memory": "750Mi" }, "min": { "cpu": "10m", "memory": "5Mi" }, "type": "Pod" }, { "default": { "cpu": "100m", "memory": "100Mi" }, "max": { "cpu": "500m", "memory": "750Mi" }, "min": { "cpu": "10m", "memory": "5Mi" }, "type": "Container" } ] } }, { "apiVersion": "v1", "groupNames": [], "kind": "RoleBinding", "metadata": { "creationTimestamp": null, "name": "admins", "namespace": "${PROJECT_NAME}" }, "roleRef": { "name": "admin" }, "subjects": [ { "kind": "User", "name": "${PROJECT_ADMIN_USER}" } ], "userNames": [ "${PROJECT_ADMIN_USER}" ] }, { "apiVersion": "v1", "groupNames": [ "system:serviceaccounts:${PROJECT_NAME}" ], "kind": "RoleBinding", "metadata": { "creationTimestamp": null, "name": "system:image-pullers", "namespace": "${PROJECT_NAME}" }, "roleRef": { "name": "system:image-puller" }, "subjects": [ { "kind": "SystemGroup", "name": "system:serviceaccounts:${PROJECT_NAME}" } ], "userNames": [] }, { "apiVersion": "v1", "groupNames": [], "kind": "RoleBinding", "metadata": { "creationTimestamp": null, "name": "system:image-builders", "namespace": "${PROJECT_NAME}" }, "roleRef": { "name": "system:image-builder" }, "subjects": [ { "kind": "ServiceAccount", "name": "builder" } ], "userNames": [ "system:serviceaccount:${PROJECT_NAME}:builder" ] }, { "apiVersion": "v1", "groupNames": [], "kind": "RoleBinding", "metadata": { "creationTimestamp": null, "name": "system:deployers", "namespace": "${PROJECT_NAME}" }, "roleRef": { "name": "system:deployer" }, "subjects": [ { "kind": "ServiceAccount", "name": "deployer" } ], "userNames": [ "system:serviceaccount:${PROJECT_NAME}:deployer" ] } ], "parameters": [ { "name": "PROJECT_NAME" }, { "name": "PROJECT_DISPLAYNAME" }, { "name": "PROJECT_DESCRIPTION" }, { "name": "PROJECT_ADMIN_USER" } ] } Looks like a few things are going on: 1. The kube API versions are being incorrectly reversed in pkg/api/install/install.go#init(), so v1beta3 is being preferred over v1 2. The kube client isn't doing any sort of negotiation or api version selection based on what is enabled for the server See https://github.com/openshift/origin/pull/5454 Also, the test has been updated to ensure this doesn't slip again. Verified on openshift v3.1.0.2 kubernetes v1.1.0-origin-1107-g4c8e6f4 etcd 2.1.2 Steps: 1. Create a template file with LimitRange and ResourceQuota for the project 2. Create the template under the default project 3. Edit the /etc/origin/master/master-config.yaml, add the template to key projectRequestTemplate 4. Restart master 5. oc new-project demo --display-name='OpenShift 3 Demo' --description='This is the first demo project with OpenShift v3' --loglevel=8 6. oc describe project demo Results: After step 5: I1109 19:33:23.341338 44319 debugging.go:99] GET https://openshift-140.lab.eng.nay.redhat.com:8443/api I1109 19:33:23.341478 44319 debugging.go:106] Request Headers: I1109 19:33:23.341488 44319 debugging.go:109] User-Agent: oc/v1.1.0 (linux/amd64) kubernetes/4c8e6f4 I1109 19:33:23.382671 44319 debugging.go:124] Response Status: 200 OK in 41 milliseconds I1109 19:33:23.382707 44319 debugging.go:127] Response Headers: I1109 19:33:23.382716 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:23 GMT I1109 19:33:23.382724 44319 debugging.go:130] Content-Length: 32 I1109 19:33:23.382731 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:23.382738 44319 debugging.go:130] Content-Type: application/json I1109 19:33:23.382785 44319 request.go:796] Response Body: { "versions": [ "v1" ] } I1109 19:33:23.387694 44319 debugging.go:99] GET https://openshift-140.lab.eng.nay.redhat.com:8443/oapi I1109 19:33:23.387709 44319 debugging.go:106] Request Headers: I1109 19:33:23.387716 44319 debugging.go:109] User-Agent: oc/v3.1.0.2 (linux/amd64) openshift/7518115 I1109 19:33:23.389022 44319 debugging.go:124] Response Status: 200 OK in 1 milliseconds I1109 19:33:23.389069 44319 debugging.go:127] Response Headers: I1109 19:33:23.389080 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:23.389088 44319 debugging.go:130] Content-Type: application/json I1109 19:33:23.389096 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:23 GMT I1109 19:33:23.389103 44319 debugging.go:130] Content-Length: 32 I1109 19:33:23.389134 44319 request.go:796] Response Body: { "versions": [ "v1" ] } I1109 19:33:23.392094 44319 debugging.go:99] GET https://openshift-140.lab.eng.nay.redhat.com:8443/oapi/v1/projectrequests I1109 19:33:23.392113 44319 debugging.go:106] Request Headers: I1109 19:33:23.392120 44319 debugging.go:109] User-Agent: oc/v3.1.0.2 (linux/amd64) openshift/7518115 I1109 19:33:23.397457 44319 debugging.go:124] Response Status: 200 OK in 5 milliseconds I1109 19:33:23.397501 44319 debugging.go:127] Response Headers: I1109 19:33:23.397510 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:23.397517 44319 debugging.go:130] Content-Type: application/json I1109 19:33:23.397524 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:23 GMT I1109 19:33:23.397531 44319 debugging.go:130] Content-Length: 69 I1109 19:33:23.397549 44319 request.go:796] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Success"} I1109 19:33:23.397965 44319 request.go:543] Request Body: {"kind":"ProjectRequest","apiVersion":"v1","metadata":{"name":"demo","creationTimestamp":null},"displayName":"OpenShift 3 Demo","description":"This is the first demo project with OpenShift v3"} I1109 19:33:23.397997 44319 debugging.go:99] POST https://openshift-140.lab.eng.nay.redhat.com:8443/oapi/v1/projectrequests I1109 19:33:23.398006 44319 debugging.go:106] Request Headers: I1109 19:33:23.398013 44319 debugging.go:109] User-Agent: oc/v3.1.0.2 (linux/amd64) openshift/7518115 I1109 19:33:24.050944 44319 debugging.go:124] Response Status: 201 Created in 652 milliseconds I1109 19:33:24.050989 44319 debugging.go:127] Response Headers: I1109 19:33:24.050999 44319 debugging.go:130] Content-Type: application/json I1109 19:33:24.051007 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:24 GMT I1109 19:33:24.051014 44319 debugging.go:130] Content-Length: 598 I1109 19:33:24.051022 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:24.051072 44319 request.go:796] Response Body: {"kind":"Project","apiVersion":"v1","metadata":{"name":"demo","selfLink":"/oapi/v1/projectrequests/demo","uid":"af6f9444-86d5-11e5-a23a-fa163e6962d3","resourceVersion":"12623","creationTimestamp":"2015-11-09T11:33:23Z","annotations":{"openshift.io/description":"This is the first demo project with OpenShift v3","openshift.io/display-name":"OpenShift 3 Demo","openshift.io/sa.scc.mcs":"s0:c7,c4","openshift.io/sa.scc.supplemental-groups":"1000050000/10000","openshift.io/sa.scc.uid-range":"1000050000/10000"}},"spec":{"finalizers":["openshift.io/origin","kubernetes"]},"status":{"phase":"Active"}} I1109 19:33:24.051779 44319 debugging.go:99] GET https://openshift-140.lab.eng.nay.redhat.com:8443/oapi/v1/users/~ I1109 19:33:24.051797 44319 debugging.go:106] Request Headers: I1109 19:33:24.051804 44319 debugging.go:109] User-Agent: oc/v3.1.0.2 (linux/amd64) openshift/7518115 I1109 19:33:24.053210 44319 debugging.go:124] Response Status: 200 OK in 1 milliseconds I1109 19:33:24.053226 44319 debugging.go:127] Response Headers: I1109 19:33:24.053234 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:24.053241 44319 debugging.go:130] Content-Type: application/json I1109 19:33:24.053250 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:24 GMT I1109 19:33:24.053257 44319 debugging.go:130] Content-Length: 188 I1109 19:33:24.053275 44319 request.go:796] Response Body: {"kind":"User","apiVersion":"v1","metadata":{"name":"system:admin","selfLink":"/oapi/v1/users/system:admin","creationTimestamp":null},"identities":null,"groups":["system:cluster-admins"]} I1109 19:33:24.053660 44319 debugging.go:99] GET https://openshift-140.lab.eng.nay.redhat.com:8443/oapi/v1/users/~ I1109 19:33:24.053674 44319 debugging.go:106] Request Headers: I1109 19:33:24.053681 44319 debugging.go:109] User-Agent: oc/v3.1.0.2 (linux/amd64) openshift/7518115 I1109 19:33:24.054922 44319 debugging.go:124] Response Status: 200 OK in 1 milliseconds I1109 19:33:24.054938 44319 debugging.go:127] Response Headers: I1109 19:33:24.054945 44319 debugging.go:130] Cache-Control: no-store I1109 19:33:24.054953 44319 debugging.go:130] Content-Type: application/json I1109 19:33:24.054960 44319 debugging.go:130] Date: Mon, 09 Nov 2015 11:33:24 GMT I1109 19:33:24.054967 44319 debugging.go:130] Content-Length: 188 I1109 19:33:24.054982 44319 request.go:796] Response Body: {"kind":"User","apiVersion":"v1","metadata":{"name":"system:admin","selfLink":"/oapi/v1/users/system:admin","creationTimestamp":null},"identities":null,"groups":["system:cluster-admins"]} Now using project "demo" on server "https://openshift-140.lab.eng.nay.redhat.com:8443". After step 6: Name: demo Created: 7 seconds ago Labels: <none> Annotations: openshift.io/description=This is the first demo project with OpenShift v3 openshift.io/display-name=OpenShift 3 Demo openshift.io/sa.scc.mcs=s0:c7,c4 openshift.io/sa.scc.supplemental-groups=1000050000/10000 openshift.io/sa.scc.uid-range=1000050000/10000 Display Name: OpenShift 3 Demo Description: This is the first demo project with OpenShift v3 Status: Active Node Selector: <none> Quota: Name: quota Resource Used Hard -------- ---- ---- cpu 0 20 memory 0 1Gi persistentvolumeclaims 0 10 pods 0 10 replicationcontrollers 0 20 resourcequotas 1 1 secrets 9 10 services 0 5 Resource limits: Name: limits Type Resource Min Max Default ---- -------- --- --- --- Container memory - - 512Mi Container cpu - - 200m Project created successfully with quota/limit range |