GitHub 操作 - 运行 kubernetes set image 命令时出错



我有这个脚本来开发 CI/CD 管道,使用 GitHub 操作。 Pipeline 的流程就像 GitHub -> Docker Hub> IBM Cloud Kubernetes。 我在运行 kubernetes set image 命令时面临这个问题 2-3 天。尝试了很多事情,但没有运气。我是 GitHub Actions 和 Kubernetes 的新手。我的剧本;

on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
run:  echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Check docker login status
if: failure()
run: echo Docker login process failed. Please check the GitHub secrets and your credentials.
#    - name: Build the Docker image
#      run:  docker build -t ${{ secrets.DOCKER_REPO }}:${GITHUB_SHA::8} .
#    - name: Publish to Docker Hub
#      run:  docker push ${{ secrets.DOCKER_USERNAME }}/nodedemoapp:${GITHUB_SHA::8}
- name: Install IBM Cloud CLI
run:  curl -sL https://ibm.biz/idt-installer | bash
- name: Login to IBM Cloud
run:  ibmcloud login -u ${{ secrets.IBMCLOUD_USER }} -p ${{ secrets.IBMCLOUD_PWD }} -r au-syd
- name: Check IBM Cloud login status
if: failure()
run: echo IBM Cloud login process failed. Please check the GitHub secrets and your credentials.
- name: Select Cloud Cluster
run:  ibmcloud cs cluster-config <cluster-name>
- name: Deploy to Cluster / Set Docker Image tag
uses: steebchen/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
with:
args: set image --record deployment/demo-nodeapp nodeapp=$DOCKER_REPO:dd317a15
#    - name: Verify Deployment
#      uses: steebchen/kubectl@master
#      env:
#              KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
#              DEPLOYMENT_NAME: ${{ secrets.DEPLOYMENT_NAME }}
#      with:
#              args: '"rollout status deployment/$DEPLOYMENT_NAME"'

在执行它时,这是我面临的错误;

Deploy to Cluster / Set Docker Image tag1s
Run steebchen/kubectl@master
/usr/bin/docker run --name dfb4c0a53d7da9d4a0da4645e42a044b525_8e2c1f --label 488dfb --workdir /github/workspace --rm -e KUBE_CONFIG_DATA -e DOCKER_REPO -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -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 -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/nodeApp/nodeApp":"/github/workspace" 488dfb:4c0a53d7da9d4a0da4645e42a044b525 set image --record deployment/*** ***=$DOCKER_REPO:dd317a15
error: unable to read certificate-authority /tmp/ca-syd01-launchpad.pem for launchpad/bl7ncphs04difh8d6be0 due to open /tmp/ca-syd01-launchpad.pem: no such file or directory
##[error]Docker run failed with exit code 1

GitHub 操作中的错误

提前谢谢。

我认为您需要检查ibmcloud cs cluster-config <cluster-name>输出以确保它得到您想要的。除非您在运行获取集群配置之前设置了IKS_BETA_VERSION=1env var,否则您将在 $HOME/.bluemix/plugins/container-service/clusters/上将 kubeconfig 和证书数据下载到本地机器。如果您使用IKS_BETA_VERSION=1env var,那么您将在默认的 kubeconfig 位置 $HOME/.kube/config 中获得上下文/集群/身份验证信息

相关内容

  • 没有找到相关文章

最新更新