I am getting " Logstash tried to bind to port range ' when installing logstash in openshift.
Below is the Config map and Logstsh Yaml file.
Logstash Config
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-config
namespace: kube-system
labels:
task: logging
k8s-app: logstash
data:
logstash.yml: |
http.host: "0.0.0.0"
path.config: /usr/share/logstash/pipeline
pipeline.conf: "
input {
tcp {
codec => fluent
port => 4000
}
}
filter {
grok{
match=>{
"source"=>"%{GREEDYDATA}/%{GREEDYDATA:app}-%{DATA}-%{DATA}%{DATA:namespace}%{GREEDYDATA}"
}
}
}
output {\n
elasticsearch {\n
hosts => ["logging-elasticsearch.kube-system:9200"]\n
sniffing => false\n
manage_template => false\n
index => "%{[type]}-%{+YYYY.MM.dd}"\n
document_type => "%{[@metadata][type]}"\n
}\n
}\n"
Logstash Yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: logging-logstash
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
task: logging
k8s-app: logstash
spec:
containers:
- name: logstash
image: schikin/logstash:5.5
imagePullPolicy: Always
volumeMounts:
- mountPath: /config
name: config
- mountPath: /pipeline
name: pipeline
volumes:
- name: config
configMap:
name: logstash-config
items:
- key: logstash.yml
path: logstash.yml
- name: pipeline
configMap:
name: logstash-config
items:
- key: pipeline.conf
path: pipeline.conf
securityContext:
fsGroup: 101
apiVersion: v1
kind: Service
metadata:
labels:
task: logging
kubernetes.io/name: logstash
name: logging-logstash
namespace: kube-system
spec:
ports:
- port: 4000
#port: 5000
targetPort: 4000
#targetPort: 5000
name: lumberjack
selector:
k8s-app: logstash