AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1146673
Accepted
Red Cricket
Red Cricket
Asked: 2023-10-27 10:51:42 +0800 CST2023-10-27 10:51:42 +0800 CST 2023-10-27 10:51:42 +0800 CST

HostAlias 在 AWX 操作员 POD 中被忽略

  • 772

我最近不得不移动运行 AWX-operator 的 K3 集群。我的节点的 IP 地址必须从 10.0.3.51、10.0.3.52、10.0.3.53 更改为 10.6.3.44、10.6.3.45、10.6.3.71。我在 awx-demo 部署中更新了 hostAlias:

271       dnsPolicy: ClusterFirst
272       hostAliases:
273       - hostnames:
274         - awx.example.com
275         ip: 10.6.3.44
276       initContainers:
277       - command:
278         - /bin/sh
279         - -c
280         - |
281           hostname=$MY_POD_NAME
282           receptor --cert-makereq bits=2048 commonname=$hostname dnsname=$hostname nodeid=$hostname outreq=/etc/receptor/tls/receptor.req outkey=/etc/receptor/tls/receptor.key
283           receptor --cert-signreq req=/etc/receptor/tls/receptor.req cacert=/etc/receptor/tls/ca/receptor-ca.crt cakey=/etc/receptor/tls/ca/receptor-ca.key outcert=/etc/receptor/tls/    receptor.crt verify=yes

但在我的自动化作业 Pod 上,/etc/hosts 文件仍然具有旧的 IP 地址。创建自动化作业 Pod 后,我该如何更正 /etc/hosts?

我可以像这样进入自动化容器并显示 /etc/hosts

$ kubectl -n awx exec -it automation-job-19120-2npln -- bash
bash-4.4$ cat /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1   localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.42.1.31  automation-job-19120-2npln

# Entries added by HostAliases.
10.0.3.51   awx.example.com
bash-4.4$

如果我编辑 Pod,我会看到这个......

apiVersion: v1
kind: Pod
metadata:
  ... omitted ...
spec:
  automountServiceAccountToken: false
  containers:
  - args:
    - ansible-runner
    - worker
    - --private-data-dir=/runner
    image: quay.io/ansible/awx-ee:latest
    imagePullPolicy: Always
    name: worker
    resources:
      requests:
        cpu: 250m
        memory: 100Mi
    stdin: true
    stdinOnce: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  hostAliases:
  - hostnames:
    - awx.example.com
    ip: 10.0.3.51
  nodeName: rocky-k3-3
  ... omitted ...

10.0.3.51 到底是从哪里来的?

kubernetes
  • 1 1 个回答
  • 41 Views

1 个回答

  • Voted
  1. Best Answer
    Red Cricket
    2023-10-27T23:43:47+08:002023-10-27T23:43:47+08:00

    AWX 邮件列表中的某人提醒我,我需要使用 AWX Web UI 控制台来更新管理站 >> 组实例 >>“默认”并更新hostAliases其中的定义。来自文档:https://docs.ansible.com/automation-controller/latest/html/administration/containers_instance_groups.html#customize-the-pod-spec

    • 0

相关问题

  • Nvidia Config 后 Containerd 无法启动

  • 在使用 kubeadm 引导集群之前,如何修改 CoreDNS 配置映射?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve