오류: 'container-name'이라는 컨테이너를 찾을 수 없습니다. [닫힘]

오류: 'container-name'이라는 컨테이너를 찾을 수 없습니다. [닫힘]

GitHub Actions에서 이 명령을 사용하여 kubernetes 클러스터의 컨테이너를 업데이트할 때:

 - name: deploy to cluster
      uses: steebchen/[email protected]
      with: # defaults to latest kubectl binary version
        config: ${{ secrets.KUBE_CONFIG_DATA }}
        command: set image --record deployment/dolphin-post-service container-name=registry.cn-hangzhou.aliyuncs.com/reddwarf-pro/dolphin-post:${{ github.sha }} -n reddwarf-pro
    

하지만 다음 오류가 표시됩니다.

Run steebchen/[email protected]
/usr/bin/docker run --name bec5f6492abb1d7d240cb997ecb72c649186a_87c72d --label 3bec5f --workdir /github/workspace --rm -e JAVA_HOME_11.0.12_x64 -e JAVA_HOME -e JAVA_HOME_11_0_12_X64 -e INPUT_CONFIG -e INPUT_COMMAND -e INPUT_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/retire/retire":"/github/workspace" 3bec5f:6492abb1d7d240cb997ecb72c649186a  "latest" "***" "set image --record deployment/dolphin-post-service container-name=***/reddwarf-pro/dolphin-post:db9f88cf905016159a2fb0f1ba4d54246f671116 -n reddwarf-pro"
using [email protected]
Flag --record has been deprecated, --record will be removed in the future
error: unable to find container named "container-name"
deployment.apps/dolphin-post-service image updated

이 문제를 해결하려면 어떻게 해야 합니까?

ベストアンサー1

나는 마침내 컨테이너 이름이 kubernetes 제어(kubectl)의 핵심이 아니라 kubernetes의 컨테이너 이름이라는 것을 이해했습니다. 나는 이것을 하고 수정했습니다.

- name: deploy to cluster
  uses: steebchen/[email protected]
  with: # defaults to latest kubectl binary version
    config: ${{ secrets.KUBE_CONFIG_DATA }}
    command: set image --record deployment/dolphin-post-service dolphin-post-service=registry.cn-hangzhou.aliyuncs.com/reddwarf-pro/dolphin-post:${{ github.sha }} -n reddwarf-pro

container-name로 교체하세요 dolphin-post-service.

おすすめ記事