繁体   English   中英

如何让 Kubernetes (GKE) 直接登录 ECK

[英]How to have Kubernetes (GKE) direct logs into ECK

我一直在为 GKE 托管的项目设置 elasticsearch 和 kibana(我们的日志目前由 stackdriver 处理)。 具体来说,我们选择使用由谷歌作为合作伙伴服务提供的弹性托管服务。 目前,我已经按照提供的快速入门,并以本文为补充。

我能够从快速开始运行中获取资源,但是我在试图确定当前如何将 stackdriver 指向我已成功设置的弹性资源时陷入困境。

以下是我申请的资源:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: vorto-server
  name: vorto-server-blank-deployment
  namespace: vorto
spec:
  replicas: 1
  selector:
    matchLabels:
      app: vorto-server
      tier: proxy
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: vorto-server
        tier: proxy
    spec:
      containers:
        - env:
            - name: BRANCH
              value: stage
            - name: GRPC_GO_REQUIRE_HANDSHAKE
              value: "off"
            - name: CONSUL_URL
              value: "consul-server:8500"
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          image: shaleapps/sandbox:other-beacon
          imagePullPolicy: Always
          name: vorto-server
          ports:
            - containerPort: 50051
              name: service
              protocol: TCP
      restartPolicy: Always
      imagePullSecrets:
        - name: dockersecret
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: vorto-server
spec:
  version: 7.7.0
  nodeSets:
    - name: vorto
      count: 1
      config:
        node.master: true
        node.data: true
        node.ingest: true
        node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: vorto-server
spec:
  version: 7.7.0
  count: 1
  elasticsearchRef:
    name: vorto-server

在我看来,我需要从shaleapps/sandbox:other-beacon (每 n 秒记录一次 hello world)进行某种端口转发。 我也怀疑我的服务资源不足; 我已经使用 kubectl 来验证在快速入门期间创建的服务是否存在。 我也认为我可能误解了 ECK 的性质; 快速入门讨论了为弹性设置离散集群,但我想让它“处理”特定集群的日志记录。

kubectl get pods
consul-mnc6r                                     1/1     Running   0          19d
consul-nxzxx                                     1/1     Running   0          19d
consul-server-0                                  1/1     Running   0          19d
consul-server-1                                  1/1     Running   0          19d
consul-server-2                                  1/1     Running   0          19d
consul-sfqvz                                     1/1     Running   0          19d
consul-sync-catalog-958fbd449-bb9qm              1/1     Running   0          19d
redis-master-64c984d564-lrd9p                    1/1     Running   0          27h
vorto-server-blank-deployment-78785bcdb4-rjtsb   1/1     Running   0          7h7m
vorto-server-deployment-788955fd67-pflpw         1/1     Running   0          4h48m
vorto-server-es-vorto-0                          1/1     Running   0          8h
vorto-server-kb-85764554db-c5rxn                 1/1     Running   0          8h
vorto-web-fc9ccff9-7x4l4                         1/1     Running   0          3h22m
vorto-web-fc9ccff9-jx88j                         1/1     Running   0          3h22m
vorto-web-fc9ccff9-plvln                         1/1     Running   0          3h22m


kubectl get services
consul                      ExternalName   <none>         consul.service.consul   <none>                                                                    19d
consul-dns                  ClusterIP      10.81.5.19     <none>                  53/TCP,53/UDP                                                             19d
consul-server               ClusterIP      None           <none>                  8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP   19d
consul-ui                   ClusterIP      10.81.3.51     <none>                  80/TCP                                                                    19d
redis-master                ClusterIP      10.81.10.152   <none>                  6379/TCP                                                                  27h
vorto-server                NodePort       10.81.13.230   <none>                  80:31326/TCP                                                              16d
vorto-server-es-http        ClusterIP      10.81.11.69    <none>                  9200/TCP                                                                  8h
vorto-server-es-transport   ClusterIP      None           <none>                  9300/TCP                                                                  8h
vorto-server-es-vorto       ClusterIP      None           <none>                  <none>                                                                    8h
vorto-server-kb-http        LoadBalancer   10.81.0.34     35.188.43.19            5601:30338/TCP                                                            7h57m
vorto-web                   NodePort       10.81.12.22    <none>                  80:30710/TCP                                                              19d

kubectl get deployments
consul-sync-catalog             1/1     1            1           19d
redis-master                    1/1     1            1           27h
vorto-server-blank-deployment   1/1     1            1           9h
vorto-server-deployment         1/1     1            1           16d
vorto-server-kb                 1/1     1            1           8h
vorto-web                       3/3     3            3           19d

这里的任何帮助将不胜感激。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM