Kubernetes Service 没有活动 Endpoint

2024-04-27

我创建了一个Deployment, Service and an Ingress。不幸的是,ingress-nginx-controllerpod 抱怨我的Service没有活动端点:

controller.go:920] Service "<namespace>/web-server" does not have any active Endpoint.

My Service定义:

apiVersion: v1
kind: Service
metadata:
  annotations:
    prometheus.io/should_be_scraped: "false"
  creationTimestamp: "2021-06-22T07:07:18Z"
  labels:
    chart: <namespace>-core-1.9.2
    release: <namespace>
  name: web-server
  namespace: <namespace>
  resourceVersion: "9050796"
  selfLink: /api/v1/namespaces/<namespace>/services/web-server
  uid: 82b3c3b4-a181-4ba2-887a-a4498346bc81
spec:
  clusterIP: 10.233.56.52
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 8080
  selector:
    app: web-server
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

My Deployment定义:

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  creationTimestamp: "2021-06-22T07:07:19Z"
  generation: 1
  labels:
    app: web-server
    chart: <namespace>-core-1.9.2
    release: <namespace>
  name: web-server
  namespace: <namespace>
  resourceVersion: "9051062"
  selfLink: /apis/apps/v1/namespaces/<namespace>/deployments/web-server
  uid: fb085727-9e8a-4931-8067-fd4ed410b8ca
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: web-server
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: web-server
    spec:
      containers:
      - env:
        <removed environment variables>
        image: <url>/<namespace>/web-server:1.10.1
        imagePullPolicy: IfNotPresent
        name: web-server
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 8082
          name: metrics
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /actuator/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            memory: 1Gi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /config
          name: <namespace>-config
      dnsPolicy: ClusterFirst
      hostAliases:
      - hostnames:
        - <url>
        ip: 10.0.1.178
      imagePullSecrets:
      - name: registry-pull-secret
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: <namespace>-config
        name: <namespace>-config
status:
  conditions:
  - lastTransitionTime: "2021-06-22T07:07:19Z"
    lastUpdateTime: "2021-06-22T07:07:19Z"
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: "False"
    type: Available
  - lastTransitionTime: "2021-06-22T07:17:20Z"
    lastUpdateTime: "2021-06-22T07:17:20Z"
    message: ReplicaSet "web-server-6df6d6565b" has timed out progressing.
    reason: ProgressDeadlineExceeded
    status: "False"
    type: Progressing
  observedGeneration: 1
  replicas: 1
  unavailableReplicas: 1
  updatedReplicas: 1

在同一个命名空间中,我有更多Service and Deployment资源,所有这些都有效,除了这个(+另一个,见下文)。

# kubectl get endpoints -n <namespace>
NAME                 ENDPOINTS                                                          AGE
activemq             10.233.64.3:61613,10.233.64.3:8161,10.233.64.3:61616 + 1 more...   26d
content-backend      10.233.96.17:8080                                                  26d
datastore3           10.233.96.16:8080                                                  26d
web-server                                                                              74m
web-server-metrics                                                                      26d

如您所见,选择器/标签是相同的(web-server) 在里面Service以及在Deployment定义。


C-Nan https://stackoverflow.com/users/13524500/c-nan已经解决了问题,并发布了解决方案作为评论:

我发现了这个问题。 Pod 已启动,但由于 readinessProbe 失败而未处于 Ready 状态。我不知道在 Pod 处于就绪状态之前不会创建端点。删除 readinessProbe 创建了 Endpoint。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Kubernetes Service 没有活动 Endpoint 的相关文章

随机推荐

  • 循环遍历 POST 数组

    我需要循环遍历 post 数组并提交它 stuff 1
  • 如何训练具有 2D 输出的网络? (蟒蛇,凯拉斯)

    我想训练一个回归网络 其输出是两个坐标 x1 y1 和 x2 y2 我的问题是 如果我想训练网络 我的输出应该分开吗 我的意思是我的输出应该是这样的 x1 y1 x2 y2 或者有没有办法将它们堆叠起来 例如 x1 y1 x2 y2 提前致
  • 明确的追溯 .gitignore (如何让 Git 完全/追溯地*忘记*现在在 .gitignore 中的文件)

    Preface This question attempts to clear the confusion regarding applying gitignore retroactively not just to the present
  • 使用局部函数和全局函数哪个更优化?

    我想知道使用 a 是否更优化局部功能 在下面的例子中 drawBitmap 只需要3个参数 and 无法内联因为该函数访问一些所有者过程变量 或者使用可以内联的全局函数 但它真的会内联吗 这需要5个参数 也不知道这是否重要 但是这段代码主要
  • C# 析构函数未按预期工作

    请参阅下面的代码 我希望它打印 10 之一 因为我已经显式调用了垃圾收集器 但我总是得到 0 或 20 作为输出 这是为什么 void Main Panda forest panda new Panda 10 for int i 0 i
  • 将数据导入mysql的最佳方法

    我有一个包含 500 000 行和大约 10 列的表 该表处于访问状态 我如何将其导入到mysql 这是关于该主题的文章 http www kitebird com articles access migrate html http www
  • C# 判断一个数是否为无穷大

    我有一个小问题 我有两个双精度变量 每个变量的值为 1 10 250 现在 如果我将这两个值相乘 我会得到一个结果 它也是一个双精度变量 问题是乘法的结果给了我无穷大的值 但我想防止这种情况并给出错误消息 因此 如果有人知道如何识别数字是否
  • SQL 中的双冒号 `::` 表示法

    我捡到了某人的代码 以下是其中的一部分WHERE条款 这里的双冒号表示什么 b date completed gt a dc date INTERVAL 1 DAY 7 20 00 它根据 RDBMS 的不同而有所不同 但如果我猜对的话 那
  • 删除 rmarkdown 文档中的部分

    我希望将章节标题放在页眉而不是页面正文中 fancyhead C 将节标题放在标题中 但如何抑制节的正文打印 title Untitled classoption landscape output pdf document number s
  • 如何从 UIView 中仅删除用户添加的子视图

    我试图删除添加到视图中的所有子视图 因此我实现了一个循环来使用以下内容迭代子视图 for subview in view subviews println subview subview removeFromSuperview 我通过向我的
  • 如何在 Dart 中保存文本输入框中的值并稍后加载?

    来自邮件列表 如何创建某种文本输入框 以允许我保存该文本并稍后在代码中使用它 我正在使用达特 结合使用 InputElements 和 HTML5 本地存储 Dart 中的 Storage 接口实现了 Map 因此您可以将键 值对存储为字符
  • 从一个组件访问另一个组件的方法

    我在 Angular 中 需要从另一个组件调用一个组件的方法 拥有这个组件 import Component OnInit Input from angular core Component selector app popover tem
  • Excel 单元格到文本框的超链接

    我正在尝试手动将超链接放入单元格中 指向文本框 网上搜索无果 在 添加超链接 对话框窗口中 我尝试在 单元格引用类型 窗口中写入文本框的名称 TextBox1 但得到 引用无效 在同一窗口的 定义名称 下也没有 TextBox1 我的两个问
  • 大量点的贝塞尔曲线近似

    我有大约一百个点 我想用贝塞尔曲线来近似 但如果超过 25 个点 或类似的点 组合数量的阶乘计数会导致数字溢出 有没有一种方法可以以类似贝塞尔曲线的方式近似如此数量的点 平滑曲线 无需经过所有点 除了第一个和最后一个点 或者我是否需要选择另
  • 使用 css 设计 ng-bootstrap 手风琴样式

    我有一个带有手风琴的 Angular 2 组件 我使用 ng bootstrap 添加了它 一切功能正常 但是我尝试使用加载的样式 card card header card block已编译的手风琴元素具有的类 这些样式根本不会应用于元素
  • Django - 通过对两个查询集进行排序来合并它们

    我有两个模型 我正在这样查询它们 firstq FirstModel objects order by addedtime secondq SecondModel objects order by addedtime 我想对它们进行合并和排
  • 如何保存和编辑电缆打印的内容?

    这是后续如何以最小的格式将数据框导出到乳胶 https stackoverflow com questions 45929263 how to export a dataframe to latex with some minimal fo
  • 在列表列表中查找匹配值

    我正在尝试迭代 python 2 7 5 中的列表列表 并返回在第二个列表中找到第一个值的列表 如下所示 python 2 7 5 list1 aa ab bb bc cc list2 aa 1 3 7 de 2 2 1 bc 3 4 4
  • ASP.NET MVC 5 中的 Actionfilter 注入

    我有一个简单的过滤器 public class IsAdmin ActionFilterAttribute IAuthenticationFilter private string roleName IBusinessIdentity id
  • Kubernetes Service 没有活动 Endpoint

    我创建了一个Deployment Service and an Ingress 不幸的是 ingress nginx controllerpod 抱怨我的Service没有活动端点 controller go 920 Service