了解如何查看docker 镜像仓库中有哪些可用的镜像版本
登陆docker 官网 搜索 需要的镜像 如 elasticsearch
建议使用官方镜像 ,需要历史版本通过Tags 可以查找。
kibana 镜像
目前不知道什么原因filebeat docker官网查找到的镜像,查看发生错误。
直接使用centerOS 虚拟机 通过docker 命令拉取
docker pull elastic/filebeat:7.6.1
创建部署文件
[root@k8s-master elk]# cat k8s-es.yml
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
name: elasticsearch
spec:
type: NodePort
ports:
- name: db
nodePort: 30920
port: 9200
protocol: TCP
targetPort: 9200
- name: transport
nodePort: 30930
port: 9300
protocol: TCP
targetPort: 9300
selector:
run: elasticsearch
status:
loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: elasticsearch
name: elasticsearch
spec:
replicas: 1
selector:
matchLabels:
run: elasticsearch
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: elasticsearch
spec:
containers:
- env:
- name: discovery.type
value: single-node
image: elasticsearch:7.6.1
name: elasticsearch
ports:
- containerPort: 9200
name: db
protocol: TCP
- containerPort: 9300
name: tramsport
protocol: TCP
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
status: {}
kubectl apply -f k8s-es.yml
查看services 是否启动成功
[root@k8s-master elk]# kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
elasticsearch NodePort 10.20.100.250 <none> 9200:30920/TCP,9300:30930/TCP 3m31s
kubernetes ClusterIP 10.20.0.1 <none> 443/TCP 25d
查看pod是否启动成功
[root@k8s-master elk]# kubectl get pods
NAME READY STATUS RESTARTS AGE
elasticsearch-76ffcf4f9c-8mnjb 0/1 Pending 0 7s
查看状态不为running 的原因
[root@k8s-master elk]# kubectl describe pod elasticsearch-76ffcf4f9c-8mnjb
Name: elasticsearch-76ffcf4f9c-8mnjb
Namespace: default
Priority: 0
Node: <none>
Labels: pod-template-hash=76ffcf4f9c
run=elasticsearch
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: ReplicaSet/elasticsearch-76ffcf4f9c
Containers:
elasticsearch:
Image: elasticsearch:7.6.1
Ports: 9200/TCP, 9300/TCP
Host Ports: 0/TCP, 0/TCP
Limits:
cpu: 500m
memory: 1Gi
Requests:
cpu: 500m
memory: 1Gi
Environment:
discovery.type: single-node
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-cg2ks (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
default-token-cg2ks:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-cg2ks
Optional: false
QoS Class: Guaranteed
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 67s (x2 over 67s) default-scheduler 0/2 nodes are available: 1 Insufficient memory, 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
内存不足导致运行失败
删除pod,重修修改 k8s-es.yml 文件 的启动内存大小重新启动即可
[root@k8s-master elk]# kubectl delete deployment elasticsearch
deployment.apps "elasticsearch" deleted
查看pod是否启动成功
[root@k8s-master elk]# kubectl get pods
NAME READY STATUS RESTARTS AGE
elasticsearch-76ffcf4f9c-8mnjb 0/1 Running 0 7s
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。