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

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
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
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

Sounds more like a Kubernetes question.

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