kubernetes容器启动详解

docker 解析DNS失败 我之前在docker里部署的容器,今天突然访问不了了,一开始我以为是容器的问题,将容器restart,销毁重建,都没有解决。里面报大量的DNS解析错误。是没有问题的。 阅读详情

如果大家对kubernetes组件以及架构相关分析,可以看我之前的源码阅读,今天只从一个函数分析容器的启动过程,这个函数就是SyncPod,这个是创建kubelet里面最核心的一个函数了。这个方法分为五步:

//  1. Compute sandbox and container changes.
//  2. Kill pod sandbox if necessary.
//  3. Kill any containers that should not be running.
//  4. Create sandbox if necessary.
//  5. Create init containers.
//  6. Create normal containers.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

下面就逐一讲解:

1.计算容器的变化

这部分代码主要完成容器状态的变化统计,就是确定哪些容器要创建,哪些容器要删除。

    // Step 1: Compute sandbox and container changes.
    podContainerChanges := m.computePodContainerChanges(pod, podStatus)
    glog.V(3).Infof("computePodContainerChanges got %+v for pod %q", podContainerChanges, format.Pod(pod))
    if podContainerChanges.CreateSandbox {
        ref, err := ref.GetReference(api.Scheme, pod)
        if err != nil {
            glog.Errorf("Couldn't make a ref to pod %q: '%v'", format.Pod(pod), err)
        }
        if podContainerChanges.SandboxID != "" {
            m.recorder.Eventf(ref, v1.EventTypeNormal, "SandboxChanged", "Pod sandbox changed, it will be killed and re-created.")
        } else {
            glog.V(4).Infof("SyncPod received new pod %q, will create a new sandbox for it", format.Pod(pod))
        }
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

具体实现看m.computePodContainerChanges,如下:

func (m *kubeGenericRuntimeManager) computePodContainerChanges(pod *v1.Pod, podStatus *kubecontainer.PodStatus) podContainerSpecChanges {
    glog.V(5).Infof("Syncing Pod %q: %+v", format.Pod(pod), pod)

    sandboxChanged, attempt, sandboxID := m.podSandboxChanged(pod, podStatus)
    changes := podContainerSpecChanges{
        CreateSandbox:        sandboxChanged,
        SandboxID:            sandboxID,
        Attempt:              attempt,
        ContainersToStart:    make(map[int]string),
        ContainersToKeep:     make(map[kubecontainer.ContainerID]int),
        InitContainersToKeep: make(map[kubecontainer.ContainerID]int),
        ContainersToKill:     make(map[kubecontainer.ContainerID]containerToKillInfo),
    }

    // check the status of init containers.
    initFailed := false
    // always reset the init containers if the sandbox is changed.
    if !sandboxChanged {
        // Keep all successfully completed containers. If there are failing containers,
        // only keep the first failing one.
        initFailed = checkAndKeepInitContainers(pod, podStatus, changes.InitContainersToKeep)
    }
    changes.InitFailed = initFailed

    // check the status of containers.
    for index, container := range pod.Spec.Containers {
        containerStatus := podStatus.FindContainerStatusByName(container.Name)
        if containerStatus == nil || containerStatus.State != kubecontainer.ContainerStateRunning {
            if kubecontainer.ShouldContainerBeRestarted(&container, pod, podStatus) {
                message := fmt.Sprintf("Container %+v is dead, but RestartPolicy says that we should restart it.", container)
                glog.Info(message)
                changes.ContainersToStart[index] = message
            }
            continue
        }
        if sandboxChanged {
            if pod.Spec.RestartPolicy != v1.RestartPolicyNever {
                message := fmt.Sprintf("Container %+v's pod sandbox is dead, the container will be recreated.", container)
                glog.Info(message)
                changes.ContainersToStart[index] = message
            }
            continue
        }

        if initFailed {
            // Initialization failed and Container exists.
            // If we have an initialization failure everything will be killed anyway.
            // If RestartPolicy is Always or OnFailure we restart containers that were running before.
            if pod.Spec.RestartPolicy != v1.RestartPolicyNever {
                message := fmt.Sprintf("Failed to initialize pod. %q will be restarted.", container.Name)
                glog.V(1).Info(message)
                changes.ContainersToStart[index] = message
            }
            continue
        }

        expectedHash := kubecontainer.HashContainer(&container)
        containerChanged := containerStatus.Hash != expectedHash
        if containerChanged {
            message := fmt.Sprintf("Pod %q container %q hash changed (%d vs %d), it will be killed and re-created.",
                pod.Name, container.Name, containerStatus.Hash, expectedHash)
            glog.Info(message)
            changes.ContainersToStart[index] = message
            continue
        }

        liveness, found := m.livenessManager.Get(containerStatus.ID)
        if !found || liveness == proberesults.Success {
            changes.ContainersToKeep[containerStatus.ID] = index
            continue
        }
        if pod.Spec.RestartPolicy != v1.RestartPolicyNever {
            message := fmt.Sprintf("pod %q container %q is unhealthy, it will be killed and re-created.", format.Pod(pod), container.Name)
            glog.Info(message)
            changes.ContainersToStart[index] = message
        }
    }

    // Don't keep init containers if they are the only containers to keep.
    if !sandboxChanged && len(changes.ContainersToStart) == 0 && len(changes.ContainersToKeep) == 0 {
        changes.InitContainersToKeep = make(map[kubecontainer.ContainerID]int)
    }

    // compute containers to be killed
    runningContainerStatuses := podStatus.GetRunningContainerStatuses()
    for _, containerStatus := range runningContainerStatuses {
        _, keep := changes.ContainersToKeep[containerStatus.ID]
        _, keepInit := changes.InitContainersToKeep[containerStatus.ID]
        if !keep && !keepInit {
            var podContainer *v1.Container
            var killMessage string
            for i, c := range pod.Spec.Containers {
                if c.Name == containerStatus.Name {
                    podContainer = &pod.Spec.Containers[i]
                    killMessage = changes.ContainersToStart[i]
                    break
                }
            }

            changes.ContainersToKill[containerStatus.ID] = containerToKillInfo{
                name:      containerStatus.Name,
                container: podContainer,
                message:   killMessage,
            }
        }
    }

    return changes
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109

计算出哪些容器要启动放到ContainersToStart这个管道里面,哪些容器要删除放到ContainersToKill这个管道里面。

2.删除sandbox变化的pod

这个主要是当沙箱变化的时候,需要重建pod,譬如切换了pause镜像,就会触发个操作

    // Step 2: Kill the pod if the sandbox has changed.
    if podContainerChanges.CreateSandbox || (len(podContainerChanges.ContainersToKeep) == 0 && len(podContainerChanges.ContainersToStart) == 0) {
        if len(podContainerChanges.ContainersToKeep) == 0 && len(podContainerChanges.ContainersToStart) == 0 {
            glog.V(4).Infof("Stopping PodSandbox for %q because all other containers are dead.", format.Pod(pod))
        } else {
            glog.V(4).Infof("Stopping PodSandbox for %q, will start new one", format.Pod(pod))
        }

        killResult := m.killPodWithSyncResult(pod, kubecontainer.ConvertPodStatusToRunningPod(m.runtimeName, podStatus), nil)
        result.AddPodSyncResult(killResult)
        if killResult.Error() != nil {
            glog.Errorf("killPodWithSyncResult failed: %v", killResult.Error())
            return
        }
    } 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

3. 删除不需要运行的容器

当kubernetes执行删除pod的操作时候,有些pods是没必要存在的。

// Step 3: kill any running containers in this pod which are not to keep.
        for containerID, containerInfo := range podContainerChanges.ContainersToKill {
            glog.V(3).Infof("Killing unwanted container %q(id=%q) for pod %q", containerInfo.name, containerID, format.Pod(pod))
            killContainerResult := kubecontainer.NewSyncResult(kubecontainer.KillContainer, containerInfo.name)
            result.AddSyncResult(killContainerResult)
            if err := m.killContainer(pod, containerID, containerInfo.name, containerInfo.message, nil); err != nil {
                killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
                glog.Errorf("killContainer %q(id=%q) for pod %q failed: %v", containerInfo.name, containerID, format.Pod(pod), err)
                return
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

下面是调用具体的容器运行时,去删除

func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubecontainer.ContainerID, containerName string, reason string, gracePeriodOverride *int64) error {
    var containerSpec *v1.Container
    if pod != nil {
        containerSpec = kubecontainer.GetContainerSpec(pod, containerName)
    } else {
        // Restore necessary information if one of the specs is nil.
        restoredPod, restoredContainer, err := m.restoreSpecsFromContainerLabels(containerID)
        if err != nil {
            return err
        }
        pod, containerSpec = restoredPod, restoredContainer
    }
    // From this point , pod and container must be non-nil.
    gracePeriod := int64(minimumGracePeriodInSeconds)
    switch {
    case pod.DeletionGracePeriodSeconds != nil:
        gracePeriod = *pod.DeletionGracePeriodSeconds
    case pod.Spec.TerminationGracePeriodSeconds != nil:
        gracePeriod = *pod.Spec.TerminationGracePeriodSeconds
    }

    glog.V(2).Infof("Killing container %q with %d second grace period", containerID.String(), gracePeriod)

    // Run the pre-stop lifecycle hooks if applicable.
    if containerSpec.Lifecycle != nil && containerSpec.Lifecycle.PreStop != nil {
        gracePeriod = gracePeriod - m.executePreStopHook(pod, containerID, containerSpec, gracePeriod)
    }
    // always give containers a minimal shutdown window to avoid unnecessary SIGKILLs
    if gracePeriod < minimumGracePeriodInSeconds {
        gracePeriod = minimumGracePeriodInSeconds
    }
    if gracePeriodOverride != nil {
        gracePeriod = *gracePeriodOverride
        glog.V(3).Infof("Killing container %q, but using %d second grace period override", containerID, gracePeriod)
    }

    err := m.runtimeService.StopContainer(containerID.ID, gracePeriod)
    if err != nil {
        glog.Errorf("Container %q termination failed with gracePeriod %d: %v", containerID.String(), gracePeriod, err)
    } else {
        glog.V(3).Infof("Container %q exited normally", containerID.String())
    }

    message := fmt.Sprintf("Killing container with id %s", containerID.String())
    if reason != "" {
        message = fmt.Sprint(message, ":", reason)
    }
    m.generateContainerEvent(containerID, v1.EventTypeNormal, events.KillingContainer, message)
    m.containerRefManager.ClearRef(containerID)

    return err
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51

m.runtimeService.StopContainer带着优雅关闭时间的停止container,每种容器都是实现StopContainer这个接口,这个在kubelet启动的时候初始化的,之前代码已经分析过了,不再赘述。

4.创建沙箱

其实kubelet之所以引入沙箱,是想建立一个容器标准,这里可以简单理解成那个pause容器。所有的网络都是挂在这个基础容器里面。

    // Step 4: Create a sandbox for the pod if necessary.
    podSandboxID := podContainerChanges.SandboxID
    if podContainerChanges.CreateSandbox && len(podContainerChanges.ContainersToStart) > 0 {
        var msg string
        var err error

        glog.V(4).Infof("Creating sandbox for pod %q", format.Pod(pod))
        createSandboxResult := kubecontainer.NewSyncResult(kubecontainer.CreatePodSandbox, format.Pod(pod))
        result.AddSyncResult(createSandboxResult)
        podSandboxID, msg, err = m.createPodSandbox(pod, podContainerChanges.Attempt)
        if err != nil {
            createSandboxResult.Fail(kubecontainer.ErrCreatePodSandbox, msg)
            glog.Errorf("createPodSandbox for pod %q failed: %v", format.Pod(pod), err)
            return
        }
        glog.V(4).Infof("Created PodSandbox %q for pod %q", podSandboxID, format.Pod(pod))

        podSandboxStatus, err := m.runtimeService.PodSandboxStatus(podSandboxID)
        if err != nil {
            glog.Errorf("Failed to get pod sandbox status: %v; Skipping pod %q", err, format.Pod(pod))
            result.Fail(err)
            return
        }

        // If we ever allow updating a pod from non-host-network to
        // host-network, we may use a stale IP.
        if !kubecontainer.IsHostNetworkPod(pod) {
            // Overwrite the podIP passed in the pod status, since we just started the pod sandbox.
            podIP = m.determinePodSandboxIP(pod.Namespace, pod.Name, podSandboxStatus)
            glog.V(4).Infof("Determined the ip %q for pod %q after sandbox changed", podIP, format.Pod(pod))
        }
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

和上面删除的方法一样,调用相应的容器运行时去完成操作

func (m *kubeGenericRuntimeManager) createPodSandbox(pod *v1.Pod, attempt uint32) (string, string, error) {
    podSandboxConfig, err := m.generatePodSandboxConfig(pod, attempt)
    if err != nil {
        message := fmt.Sprintf("GeneratePodSandboxConfig for pod %q failed: %v", format.Pod(pod), err)
        glog.Error(message)
        return "", message, err
    }

    // Create pod logs directory
    err = m.osInterface.MkdirAll(podSandboxConfig.LogDirectory, 0755)
    if err != nil {
        message := fmt.Sprintf("Create pod log directory for pod %q failed: %v", format.Pod(pod), err)
        glog.Errorf(message)
        return "", message, err
    }

    podSandBoxID, err := m.runtimeService.RunPodSandbox(podSandboxConfig)
    if err != nil {
        message := fmt.Sprintf("CreatePodSandbox for pod %q failed: %v", format.Pod(pod), err)
        glog.Error(message)
        return "", message, err
    }

    return podSandBoxID, "", nil
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

如果是docker就在pkg/kubelet/dockershim/docker_sandbox.go这个里面RunPodSandbox实现 
无非是先拉镜像然后启动容器,只有一个cni的部分需要注意,这个在以后的代码分析中会介绍。言归正传,创建完基础容器后

5.启动init容器

init容器是为业务容器做初始化工作的,譬如可以预先从网络上面加载一些动态资源

// Step 5: start init containers.
    status, next, done := findNextInitContainerToRun(pod, podStatus)
    if status != nil && status.ExitCode != 0 {
        // container initialization has failed, flag the pod as failed
        initContainerResult := kubecontainer.NewSyncResult(kubecontainer.InitContainer, status.Name)
        initContainerResult.Fail(kubecontainer.ErrRunInitContainer, fmt.Sprintf("init container %q exited with %d", status.Name, status.ExitCode))
        result.AddSyncResult(initContainerResult)
        if pod.Spec.RestartPolicy == v1.RestartPolicyNever {
            utilruntime.HandleError(fmt.Errorf("error running pod %q init container %q, restart=Never: %#v", format.Pod(pod), status.Name, status))
            return
        }
        utilruntime.HandleError(fmt.Errorf("Error running pod %q init container %q, restarting: %#v", format.Pod(pod), status.Name, status))
    }
    if next != nil {
        if len(podContainerChanges.ContainersToStart) == 0 {
            glog.V(4).Infof("No containers to start, stopping at init container %+v in pod %v", next.Name, format.Pod(pod))
            return
        }

        // If we need to start the next container, do so now then exit
        container := next
        startContainerResult := kubecontainer.NewSyncResult(kubecontainer.StartContainer, container.Name)
        result.AddSyncResult(startContainerResult)

        isInBackOff, msg, err := m.doBackOff(pod, container, podStatus, backOff)
        if isInBackOff {
            startContainerResult.Fail(err, msg)
            glog.V(4).Infof("Backing Off restarting init container %+v in pod %v", container, format.Pod(pod))
            return
        }

        glog.V(4).Infof("Creating init container %+v in pod %v", container, format.Pod(pod))
        if msg, err := m.startContainer(podSandboxID, podSandboxConfig, container, pod, podStatus, pullSecrets, podIP); err != nil {
            startContainerResult.Fail(err, msg)
            utilruntime.HandleError(fmt.Errorf("init container start failed: %v: %s", err, msg))
            return
        }

        // Successfully started the container; clear the entry in the failure
        glog.V(4).Infof("Completed init container %q for pod %q", container.Name, format.Pod(pod))
        return
    }
    if !done {
        // init container still running
        glog.V(4).Infof("An init container is still running in pod %v", format.Pod(pod))
        return
    }
    if podContainerChanges.InitFailed {
        glog.V(4).Infof("Not all init containers have succeeded for pod %v", format.Pod(pod))
        return
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51

方法通过m.startContainer启动initcontainer。

6.启动业务容器

到这一步才是启动客户自己定义的容器。

// Step 6: start containers in podContainerChanges.ContainersToStart.
    for idx := range podContainerChanges.ContainersToStart {
        container := &pod.Spec.Containers[idx]
        startContainerResult := kubecontainer.NewSyncResult(kubecontainer.StartContainer, container.Name)
        result.AddSyncResult(startContainerResult)

        isInBackOff, msg, err := m.doBackOff(pod, container, podStatus, backOff)
        if isInBackOff {
            startContainerResult.Fail(err, msg)
            glog.V(4).Infof("Backing Off restarting container %+v in pod %v", container, format.Pod(pod))
            continue
        }

        glog.V(4).Infof("Creating container %+v in pod %v", container, format.Pod(pod))
        if msg, err := m.startContainer(podSandboxID, podSandboxConfig, container, pod, podStatus, pullSecrets, podIP); err != nil {
            startContainerResult.Fail(err, msg)
            utilruntime.HandleError(fmt.Errorf("container start failed: %v: %s", err, msg))
            continue
        }
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

就是通过读取podContainerChanges.ContainersToStart管道里面,需要启动的容器,然后for循环逐一创建这个pod里面的container。 
整个pod同步的代码说完了,总计6个步骤。

Kubernetes组件_Init启动日志和Join日志、核心组件 Kubernetes_架构_Init启动日志和Join日志、核心组件 阅读详情

相关推荐

【摸鱼日常】使用httpd部署adarkroom文字风格冒险小游戏

只要鼠标切得快,你咋知道我玩的是游戏?

全糖少冰我吃不了苦 1950

Kubernetes 如何运行容器?

作为一个应用开发者,你首先要做的,是制作容器的镜像。而有了容器镜像之后,你需要按照 Kubernetes 项目的规范和要求,将你的镜像组织为它能够“认识”的方式,然后提交上去。

技术分享,读书笔记,面试宝典,算法积累,应有尽有~ 1833

Kubernetes 初始化容器顺序启动

最近工作中需要保证容器启动之前PostgreSQL先启动,然后Apollo再启动,不然会出现配置加载错误的问题。Kubernetes的初始化容器就能够满足这种场景。 InitContainers能够按照资源文件中初始化容器的顺序依次启动 apiVersion: apps/v1 kind: Deployment metadata: name: openailab-discovery-ser...

专注基础架构领域 6189

k8s 容器启动失败

动一下小手点一下赞。谢谢! 你的赞就是我更新的动力。Kubernetes(简称K8S)是目前最流行的容器编排平台之一,其提供了便捷的容器管理和自动化部署功能。然而,在使用K8S进行容器启动时,有时会遇到容器启动失败的问题。本文将介绍K8S容器启动失败的原因和解决方法,并提供代码示例帮助小白开发者快速解决问题。K8S容器启动...

cnzzs的博客 821

oh-my-zsh详细安装与主题插件配置

使用Linux的小伙伴都知道默认shell是bash,但是对于喜欢折腾,喜欢酷炫的我们bash怎能够用。zsh的作为一种shell,功能更强大,但是配置复杂。后来,有大佬创建了一个名为oh-my-zsh的开源项目,使用方便,功能强大。 下面就去oh-my-zsh的配置。 ①安装zsh 想要安装oh-my-zsh,首先得安装zsh,输入命令 sudo apt-get install zsh 界面如下 ②查看是否安装成功 输入命令 zsh --version 可以查看安装zsh的版本..

惜洛-Jankin的博客 2万+

arduino uno spi驱动12864

arduino uno spi驱动12864

yvee的博客 2060

[kubernetes]-k8s通过initcontainer确保容器依次启动

导语:k8s通过initcontainer确保容器依次启动,避免启动业务容器前mysql还没有用启动,mysql加入了readiness。 apiVersion: apps/v1 kind: Deployment metadata: # deployment名字 和svc 和ingress绑定没关系 name: aiserverconfig-dp namespace: default spec: replicas: 1 # 在定义模板的时候必须定义labels,因为Deployment.s

爷来辣的博客 510

Pytest 常见问题及其解决方案

Pytest 是一个强大且灵活的测试框架,但初学者在使用过程中难免会遇到各种问题。希望通过这篇文章,你能更好地应对常见的挑战,写出更高效、更稳定的测试代码。测试不是负担,而是保障。写好测试不仅能提高代码质量,还能让你在面对变更时更加从容自信。

qq_52137592的博客 901

【云原生 | 从零开始学Kubernetes】十三、k8s的容器探测以及启动探测

介绍了k8s的容器探测以及启动探测

欢迎关注,一起进步! 3083

IROS 2025机器人技术解析:从诡异设计到硬核应用

机器人技术正从传统的结构化环境应用,迈向复杂非结构化场景的深度交互。其核心原理在于通过仿生设计、多模态感知与智能控制算法,赋予机器人类似生物的适应性与交互能力。这一技术演进的价值在于突破传统机器人在极端环境、精密操作和自然交互中的瓶颈。例如,结合深度强化学习的全身动力学控制,使机器人能在废墟、管道等复杂地形中自主导航;而软体机器人技术则通过材料变形实现安全、柔顺的抓取操作。这些技术最终服务于极端环境巡检、精密装配和高端陪护等刚性应用场景,推动机器人从功能实现迈向与环境、人进行深度、智能交互的新阶段。

weixin_34006468的博客 453

使用嘉立创绘制STM32F103T8C6最小系统板

使用嘉立创EDA绘制一个属于自己的STM32最小系统板

weixin_67887035的博客 1万+

Kubernetes 上容器的启动顺序如何把控?

作者 | AddoZhang 责编 | 欧阳姝黎为什么要做容器启动顺序控制?我们都知道 Pod 中除了 init-container 之外,是允许添加多个容器的。类似 Tekt...

优快云资讯 2106

中国工商银行企业架构建设实践最全总结

中国工商银行参考IBM持续价值创新方法并吸收TOGAF等主流企业架构的框架理念,结合业务实际情况形成工行自己的企业架构方法论并实践,为数字化转型提供支撑。本案例通过介绍中国工商银行企业架构之业务架构设计方法,为其他银行企业架构建设提供参考。 企业架构是数字化转型的抓手,可以帮助企业规划、管理和实施数字化解决方案,以实现业务目标并适应不断变化的市场条件。中国工商银行通过战略目标指导业务架构的规划和设计,业务架构建模后指导IT架构建模。

银行信息系统应用架构详解 2733

k8s 启动命令cmd_Kubernetes(k8s)为容器设置启动时要执行的命令和参数

创建 Pod 时设置命令及参数创建 Pod 时,可以为其下的容器设置启动时要执行的命令及其参数。如果要设置命令,就填写在配置文件的 command 字段下,如果要设置命令的参数,就填写在配置文件的 args 字段下。一旦 Pod 创建完成,该命令及其参数就无法再进行更改了。如果在配置文件中设置了容器启动时要执行的命令及其参数,那么容器镜像中自带的命令与参数将会被覆盖而不再执行。如果配置文件中只是设...

weixin_28703451的博客 2977

相机标定(六)—— 张正友标定法

相机标定一、相机标定的目的1. 相机的成像过程2. 相机标定的目的3. 畸变与畸变矫正二、张正友标定法简介三、标定相机内外参1. 求解内参和外参的积2. 求解内参矩阵3. 求解外参矩阵四、标定相机的畸变参数五、L-M算法参数优化六、相机标定的步骤七、源代码 一、相机标定的目的 1. 相机的成像过程 2. 相机标定的目的 3. 畸变与畸变矫正 二、张正友标定法简介 三、标定相机内外参 1. 求解内参和外参的积 2. 求解内参矩阵 3. 求解外参矩阵 四、标定相机的畸变参数 五、L-M算法参数优化 六、相机

weixin_41480034的博客 1万+

第150篇 激光雷达点云分割——地面分离、聚类分析和物体提取

本文介绍了点云分割的三种经典几何方法:RANSAC地面分离、欧式聚类和区域生长。RANSAC通过随机采样拟合平面实现地面分割,欧式聚类基于空间距离进行物体分割,区域生长则结合法线信息提升分割精度。文章对比了各种方法的优缺点,提供了参数选择建议,并指出实际项目中常组合使用这些方法。最后给出了面试应答技巧,强调几何方法速度快、可解释性强等优势,适合大多数机器人项目的实时需求。

郑伟强dev的专栏 192

K8s 容器启动全流程:从 kubelet 到 Linux 内核

kubelet 只负责 "我要启动一个容器",至于底层用什么运行时、怎么启动,kubelet 完全不关心,只要你符合 CRI 标准,就能对接,这也是 K8s 能支持这么多容器运行时的原因。这也是容器为什么这么轻量的原因:容器不是虚拟化,它就是一个被内核隔离、限制的普通进程,所有能力都是内核早就有的,Docker/CRI-O 只是把这些能力打包成了好用的工具而已。runc 启动完容器内的进程之后,容器就正式运行起来了,这时候它就是一个独立的、被隔离的进程,有自己的环境,跑我们的业务应用。

2302_80661243的博客 585

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Kubernetes 上如何控制容器的启动顺序?

去年写过一篇博客:控制 Pod 内容器的启动顺序,分析了 TektonCD 的容器启动控制的原理。 为什么要做容器启动顺序控制?我们都知道 Pod 中除了 init-container 之外,是允许添加多个容器的。类似 TektonCD 中 task 和 step 的概念就分别与 pod 和 container 对应,而 step 是按照顺序执行的。此外还有服务网格的场景,sidecar 容器需要在服务容器启动之前完成配置的加载,也需要对容器的启动顺序加以控制。否则,服务容器先启动,而 sidecar 还

hanfengzxh的博客 2552

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

【Kubernetes 007】容器生命周期之启动退出动作

通过前面两节的学习,容器生命周期就只剩下最后的一点点边角料了,这一节我们把它们都学完。 我是T型人小付,一位坚持终身学习的互联网从业者。喜欢我的博客欢迎在csdn上关注我,如果有问题欢迎在底下的评论区交流,谢谢。 文章目录启动和退出动作Pod的status总结 启动和退出动作 以下所有yaml文件都托管在Github: https://github.com/Victor2Code/centos...

T型人小付的博客 660

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

【kubernetes/k8s源码分析】kubelet源码分析之启动容器

主要是调用runtime,这里默认为docker 0. 数据流 NewMainKubelet(cmd/kubelet/app/server.go) -> NewKubeGenericRuntimeManager(pkg/kubelet/kuberuntime/kuberuntime_manager.go) -> syncPod(pkg/kubelet/kubelet.go) ...

zhonglinzhang 4458

K8S_pod状态-策略-启动-多容器-类型

多msater的k8s集群 控制器 pod启动流程 pod调度策略 命令 kubectl describe pod k8s-nginx-6d779d947c-vm5nw kubectl exec kubectl scale

hj的博客 2257

k8s 容器启动时传递镜像运行时参数

背景 我们使用springboot 打成的jar构建docker镜像上传到barbor镜像库之后,如果镜像中的参数发生了变化(springboot application.properties中的启动参数变更),比如mysql的地址变更了。不必修改配置文件,重新打包上传,修改k8s容器启动配置文件,重新启动容器即可 Docker file如下: FROM harbor.ht.com/micro-service/openjdk:8-jre MAINTAINER xxx xxx@imooc.com C

fantasticqiang的博客 8636
上一篇: Kubespray节点伸缩
下一篇: 初试 Kubernetes 集群中使用 Traefik 反向代理
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值