Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-1915

Include serviceaccount object into templates

XMLWordPrintable

      Include a serviceaccount object into templates. This will remove the need for manual creation. This will also aid in the use of the Openshift "Create from URL" feature.

      Setting template parameters in the URL:

      https://openshift.vault101.quicklab.rdu2.cee.redhat.com/console/create?template=eap70-basic-s2i&templateParamsMap={"SOURCE_REPOSITORY_URL"%3A"https:%2F%2Fgithub.com%2Fjboss-developer%2Fjboss-eap-quickstarts"}
      

      Example of a serviceaccount object and associate rolebindings object:

      Service account object:

          {
            "kind": "ServiceAccount",
            "apiVersion": "v1",
            "metadata": {
                "name": "eap-service-account"
            }
          }
      

      Role binding object:

      {
        "kind":"RoleBinding",
        "apiVersion":"v1",
        "metadata": {
            "name":"view",
            "namespace":"fooman",
            "userNames": [
                "system:serviceaccount:fooman:eap-service-account"
            ],
            "groupNames":null,
            "subjects": [
                {
                    "kind":"ServiceAccount",
                    "namespace":"fooman",
                    "name":"eap-service-account"
                }
            ],
            "roleRef": {
                "name":"view"
            }
        }
      

      We can then update documentation to remove the need for manually executing the following commands for every middleware container product.

      oc create serviceaccount eap-service-account
      oc policy add-role-to-user view system:serviceaccount:$(oc project -q):eap-service-account
      oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q)
      

              rhn-support-fspolti Filippe Spolti
              rhn-support-trogers Travis Rogers (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: