# Error creating: pods "logstash-" is forbidden: service account was not found, retry after the service account is created

**URL:** <https://discuss.elastic.co/t/error-creating-pods-logstash-is-forbidden-service-account-was-not-found-retry-after-the-service-account-is-created/111573>\
**Category:** Logstash\
**Created:** [December 13, 2017, 2:01pm UTC](https://discuss.elastic.co/t/error-creating-pods-logstash-is-forbidden-service-account-was-not-found-retry-after-the-service-account-is-created/111573 "2017-12-13T14:01:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marouane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marouane/32/83858_2.png) [@marouane](https://discuss.elastic.co/u/marouane)\
**Post date:** [December 13, 2017, 2:01pm UTC](https://discuss.elastic.co/t/error-creating-pods-logstash-is-forbidden-service-account-was-not-found-retry-after-the-service-account-is-created/111573/1 "2017-12-13T14:01:09Z")

</div>

Hello evey one,  
i'm working on logstash deployment using kubernetes:  
This is the error that i have : `Error creating: pods "logstash-" is forbidden: service account was not found, retry after the service account is created`

This is the service file :  
apiVersion: v1  
kind: Service  
metadata:  
name: logstash  
namespace: default  
labels:  
component: elk  
role: logstash  
spec:  
selector:  
component: elk  
role: logstash  
ports:

- name: lumberjack  
port: 5043  
protocol: TCP

* * *

This is the the rc file:  
apiVersion: v1  
kind: ReplicationController  
metadata:  
name: logstash  
namespace: default  
labels:  
component: elk  
role: logstash  
spec:  
replicas: 1  
selector:  
component: elk  
role: logstash  
template:  
metadata:  
labels:  
component: elk  
role: logstash  
spec:  
serviceAccount: elk  
containers:  
- name: logstash  
image: [docker.elastic.co/logstash/logstash:5.6.0](http://docker.elastic.co/logstash/logstash:5.6.0)  
env:  
- name: KUBERNETES\_TRUST\_CERT  
value: "true"  
ports:  
- containerPort: 5043  
name: lumberjack  
protocol: TCP  
volumes:  
- emptyDir:  
medium: ""  
name: "storage"

* * *

This is the result:

Name: logstash  
Namespace: default  
Selector: component=elk,role=logstash  
Labels: component=elk  
role=logstash  
Annotations:   
Replicas: 0 current / 1 desired  
Pods Status: 0 Running / 0 Waiting / 0 Succeeded / 0 Failed  
Pod Template:  
Labels: component=elk  
role=logstash  
Service Account: elk  
Containers:  
logstash:  
Image: [docker.elastic.co/logstash/logstash:5.6.0](http://docker.elastic.co/logstash/logstash:5.6.0)  
Port: 5043/TCP  
Environment:  
KUBERNETES\_TRUST\_CERT: true  
Mounts:   
Volumes:  
storage:  
Type: EmptyDir (a temporary directory that shares a pod's lifetime)  
Medium:  
Conditions:  
Type Status Reason

* * *

ReplicaFailure True FailedCreate  
Events:  
Type Reason Age From Message

* * *

Warning FailedCreate 9s (x15 over 1m) replication-controller Error creating: pods "logstash-" is forbidden: service account default/elk was not found, retry after the service account is created

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 13, 2017, 2:10pm UTC](https://discuss.elastic.co/t/error-creating-pods-logstash-is-forbidden-service-account-was-not-found-retry-after-the-service-account-is-created/111573/2 "2017-12-13T14:10:24Z")

</div>

Sounds more like a Kubernetes question.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 10, 2018, 2:10pm UTC](https://discuss.elastic.co/t/error-creating-pods-logstash-is-forbidden-service-account-was-not-found-retry-after-the-service-account-is-created/111573/3 "2018-01-10T14:10:28Z")

</div>

Closed on January 10, 2018, 2:10pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
