You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Kubernetes Provider should have created both a namespace and a service account in that namespace on OpenShift without errors.
Note that the namespace and service account actually are created despite the error and show up in terraform state list.
Actual Behavior
Rogers-MacBook-Pro:test-service-account roger$ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ kubernetes_namespace.dogs
id: <computed>
metadata.#: "1"
metadata.0.annotations.%: "3"
metadata.0.annotations.openshift.io/description: "Dogs"
metadata.0.annotations.openshift.io/display-name: "Dogs"
metadata.0.annotations.openshift.io/requester: "admin"
metadata.0.generation: <computed>
metadata.0.name: "dogs"
metadata.0.resource_version: <computed>
metadata.0.self_link: <computed>
metadata.0.uid: <computed>
+ kubernetes_service_account.dogs
id: <computed>
default_secret_name: <computed>
metadata.#: "1"
metadata.0.generation: <computed>
metadata.0.name: "dogs"
metadata.0.namespace: "dogs"
metadata.0.resource_version: <computed>
metadata.0.self_link: <computed>
metadata.0.uid: <computed>
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
kubernetes_namespace.dogs: Creating...
metadata.#: "" => "1"
metadata.0.annotations.%: "" => "3"
metadata.0.annotations.openshift.io/description: "" => "Dogs"
metadata.0.annotations.openshift.io/display-name: "" => "Dogs"
metadata.0.annotations.openshift.io/requester: "" => "admin"
metadata.0.generation: "" => "<computed>"
metadata.0.name: "" => "dogs"
metadata.0.resource_version: "" => "<computed>"
metadata.0.self_link: "" => "<computed>"
metadata.0.uid: "" => "<computed>"
kubernetes_namespace.dogs: Creation complete after 0s (ID: dogs)
kubernetes_service_account.dogs: Creating...
default_secret_name: "" => "<computed>"
metadata.#: "" => "1"
metadata.0.generation: "" => "<computed>"
metadata.0.name: "" => "dogs"
metadata.0.namespace: "" => "dogs"
metadata.0.resource_version: "" => "<computed>"
metadata.0.self_link: "" => "<computed>"
metadata.0.uid: "" => "<computed>"
Error: Error applying plan:
1 error(s) occurred:
* kubernetes_service_account.dogs: 1 error(s) occurred:
* kubernetes_service_account.dogs: Expected 1 generated default secret, 2 found: [{ dogs-dockercfg-4fh66 } { dogs-token-xfkg2 }]
Both the namespace (which in OpenShift is a project) and the service account were created despite the error!
The project and service account also both show up in Terraform state:
$ terraform state list
kubernetes_namespace.dogs
kubernetes_service_account.dogs
$ oc projects
You have access to the following projects and can switch between them with 'oc project <projectname>':
* cats-and-dogs - Cats and Dogs
default
dogs
kube-public
kube-system
logging
management-infra
openshift
openshift-infra
openshift-node
$ kubectl get sa dogs -o yaml
However, the project did not show up in the OpenShift Console until I ran oadm policy add-role-to-user admin admin after first selecting the new project with oc project dogs.
Note that the Terraform state does not have the default_secret_name attribute:
In contrast, when I created a service account with the Kubernetes Provider against Azure Container Service and Google Container Engine, the state in TFE did show an item like "default_secret_name": "cats-and-dogs-token-2f0b2".
Steps to Reproduce
terraform apply
Important Factoids
The problem with OpenShift seems to be that a service account always has 2 secrets, one for service account authentication and one for Docker. For example, here is the output from a service account I created with kubectl:
The token/secret that I needed to use for authenticating against the Vault Kubernetes auth backend was the first. I think the Kubernetes Provider is unable to decide which token to assign to the default_secret_name computed attribute.
The text was updated successfully, but these errors were encountered:
Terraform Version
0.11.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The Kubernetes Provider should have created both a namespace and a service account in that namespace on OpenShift without errors.
Note that the namespace and service account actually are created despite the error and show up in
terraform state list
.Actual Behavior
Both the namespace (which in OpenShift is a project) and the service account were created despite the error!
The project and service account also both show up in Terraform state:
However, the project did not show up in the OpenShift Console until I ran
oadm policy add-role-to-user admin admin
after first selecting the new project withoc project dogs
.Note that the Terraform state does not have the default_secret_name attribute:
In contrast, when I created a service account with the Kubernetes Provider against Azure Container Service and Google Container Engine, the state in TFE did show an item like "default_secret_name": "cats-and-dogs-token-2f0b2".
Steps to Reproduce
terraform apply
Important Factoids
The problem with OpenShift seems to be that a service account always has 2 secrets, one for service account authentication and one for Docker. For example, here is the output from a service account I created with kubectl:
The token/secret that I needed to use for authenticating against the Vault Kubernetes auth backend was the first. I think the Kubernetes Provider is unable to decide which token to assign to the default_secret_name computed attribute.
The text was updated successfully, but these errors were encountered: