【问题标题】:What happens to systemd services after migrating GCE VM to GKE?将 GCE 虚拟机迁移到 GKE 后,systemd 服务会发生什么?
【发布时间】:2019-11-12 22:54:15
【问题描述】:

我正在关注doc 来测试将 GCE 虚拟机迁移到 GKE,但我不清楚迁移后我的 systemd 服务会发生什么。通常容器用于运行单个应用程序而不是许多守护进程。

我尝试查看 Pod 中是否正在运行 systemd 服务,但失败了:

$ kubectl exec -it my-app-0 -- systemctl status
System has not been booted with systemd as init system (PID 1). Can't operate.
command terminated with exit code 1

我认为文档需要改进,以包含有关迁移后 Pod 发生情况的更多详细信息。除了 systemd 服务,Pod 中容器的入口点是什么?

【问题讨论】:

    标签: google-anthos


    【解决方案1】:

    对于迁移的容器,这应该会给你想要的结果:
    kubectl exec -it my-app-0 -- bash -c "systemctl status"

    【讨论】:

      猜你喜欢
      • 2020-07-11
      • 2023-02-09
      • 1970-01-01
      • 2014-08-06
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 2022-07-31
      • 1970-01-01
      相关资源
      最近更新 更多