马弁是什么意思| 夜间盗汗是什么原因| 耐人寻味是什么意思| 硬下疳是什么| 李小龙是什么生肖| 尿痛什么原因引起的| 脸上痣多是什么原因| 为什么女人比男人长寿| 备孕是什么意思| 低筋面粉可以用什么代替| 祸从天降是什么生肖| 梦见儿子小时候是什么意思| 糖皮质激素是什么| 双侧乳腺结构不良什么意思| 11月14号什么星座| 1.4什么星座| 木鱼花是什么做的| 脖子后面长痘痘是什么原因| 血糖高喝什么稀饭好| 什么鸡最好吃| 门的单位是什么| 饭中吃药是什么时候吃| 大云是什么| 率性是什么意思| 什么的尾巴长不了歇后语| hpv感染什么症状| nt什么意思| 孩子咳嗽吃什么饭菜好| 欧什么意思| 1949年是什么年| 肚子突然变大是什么原因| 宁属于五行属什么| 总是睡不着觉是什么原因| 经辐照是什么意思| 肉苁蓉和什么搭配最好| 陪嫁一般陪些什么东西| 哺乳期感冒可以吃什么药| 化疗后吃什么食物最好| 生辰八字指什么| 关羽的武器叫什么| 虎都男装属于什么档次| oba是什么意思| igm是什么意思| 血塞通治什么病最好| 什么非常什么写句子| 七月二十四是什么星座| 韩国买什么东西划算| 睡多了头疼是什么原因| 尿道炎症状吃什么药| 阴道红肿是什么原因| hla医学上是什么意思| 白头发补什么维生素| 荔枝什么品种最贵| 花木兰属什么生肖| 五行什么生火| 田五行属什么| 什么叫黑户| 月经周期短是什么原因| 经常吃豆腐有什么好处和坏处| 电影bd是什么意思| 动物园里面有什么动物| 睡觉喉咙干燥是什么原因| 眼皮浮肿是什么原因| 讣告什么意思| 蛇毒有什么用| 寓是什么意思| 什么是零重力座椅| 猪肚和什么煲汤最好| 朕是什么时候开始用的| 妩媚是什么意思| 婴儿拉奶瓣是什么原因| 什么时候受孕率最高| leep是什么手术| 心脏在乳房的什么位置| 膑是什么意思| 牛奶不能和什么东西一起吃| 看脱发应该挂什么科| 戏是什么意思| 骨折吃什么| 1948年中国发生了什么| 什么是总胆固醇| 什么是慈悲| europe是什么意思| 眼睛流泪用什么眼药水| 60岁男人喜欢什么样的女人| 脆鱼是什么鱼| 世界上最大的鸟是什么鸟| 宝宝拉肚子吃什么药好| 微不足道是什么意思| 什么季节最短| 泽泻是什么| 羊肉和什么不能一起吃| 为什么叫211大学| 力所能及什么意思| 寻常疣是什么| 什么地| 61是什么意思| 蓝色妖姬的花语是什么| dr股票是什么意思| 香港五行属什么| 火龙果是什么颜色| 羟丁酸脱氢酶高是什么原因| 隆胸有什么危害和后遗症吗| 胃食管反流用什么药| 鸟屎掉身上有什么预兆| 倒嗓是什么意思| 孤魂野鬼是什么生肖| 独角仙生活在什么地方| 坐飞机需要带什么证件| 口角炎用什么药膏| 球鞋ep是什么意思| 肾结石吃什么水果好| 单侧耳鸣是什么原因引起的| 白羊座男和什么星座最配| pretty是什么意思| 元辰是什么意思| 下眼睑跳动是什么原因| 坐东北朝西南是什么宅| 什么地看| 如果怀孕了会有什么预兆| 血糖什么时候最高| 擦伤用什么药| 胃字出头念什么| 猪古代叫什么| 辣椒油用什么能洗掉| 生理需求是什么意思| 贫血去医院挂什么科| 胃疼喝什么可以缓解| eric是什么意思| 灰指甲有什么危害| 5月30是什么星座| 8月8号什么星座| 肺部气肿吃什么药能治好| 五心烦热吃什么药最快| 骨密度是检查什么的| 春回大地是什么生肖| 6月7号是什么星座| 生物学父亲是什么意思| 今天什么日子| 免疫力是什么意思| 母婴传播是什么意思| 2月18号什么星座| 苏菲是什么| 牙龈发紫是什么原因| 手背上长痣代表什么| 窗口是什么意思| 意淫什么意思| 老鹰代表什么生肖| 0点是什么时辰| 芊芊学子是什么意思| coach什么意思| 猫咪的胡须有什么作用| 疝气是什么病怎样治疗| 7月7日什么星座| 眼睛有点黄是什么原因| 吧唧嘴什么意思| 胃肠炎吃什么药| 小厨宝是什么东西| 白头翁吃什么食物| 肺部有结节要注意什么| 什么的世界| 血糖查什么项目| 大姨妈不能吃什么水果| 缺铁性贫血吃什么药| 咳白色泡沫痰是什么病| 左腹部是什么器官| 为什么乳头会有白色分泌物| 人脉是什么意思| 黄芪不适合什么人吃| 什么可以补肾壮阳| 作灶什么意思| 什么他妈的叫他妈的惊喜| 毛泽东的女儿为什么姓李| 月经总是提前是什么原因| 什么牌子的蛋白质粉比较好| 挚爱适合用在什么人| 养生馆起什么名字好| 早教是做什么的| 幼儿反复发烧是什么原因| 到底为了什么| 2月6号是什么星座| 胃复安又叫什么| 为什么会长肥胖纹| mr检查是什么意思| 尿道口感染吃什么药| 蛛网膜囊肿挂什么科| 消化功能紊乱吃什么药| 八段锦什么时间练最好| 屁的成分是什么气体| 汐五行属性是什么| 痛风用什么药治疗最好| 早上十点是什么时辰| 慢性鼻窦炎吃什么药| 直肠给药对小孩身体有什么影响| 70年属什么生肖| 宫颈纳氏囊肿什么意思| 孕妇能吃什么水果最好| 什么是痤疮图片| 雪村和赵英俊什么关系| 卖酒需要办理什么证| 班门弄斧什么意思| 脑梗不能吃什么东西| editor是什么意思| 林子祥属什么生肖| b超检查前要注意什么| 宝宝老是摇头是什么原因| 精液发红是什么原因| 女人性冷淡吃什么药效果好| 容易出汗是什么问题| 出油多是什么原因| 5月19日是什么星座| 梦见小牛犊是什么预兆| 鼓上蚤是什么意思| 蚊子为什么咬人| 97属什么| 签发是什么意思| 脖子下面的骨头叫什么| 3代表什么意思| 什么是口交| 化生是什么意思| 瑗字五行属什么| 女人大姨妈来了吃什么最好| 遁入空门是什么意思| 干燥症是什么症状| 优甲乐过量有什么症状| 乳房看什么科| 腋下黑是什么原因| 厥阴是什么意思| 摆渡人什么意思| 音序是什么| 坐月子吃什么下奶最快最多最有效| 218是什么星座| 什么叫打板| 吃什么补钾最快最好| 农历六月十二是什么日子| mchc是什么意思| 燕窝什么味道| 种马是什么意思| 脸麻手麻是什么原因| 心理活动是什么意思| 身份证x代表什么| 胃部检查除了胃镜还有什么方法| 掌门人是什么意思| 什么产品美白效果最好最快| tr是什么意思| 右枕前位是什么意思| Polo什么意思| 叶黄素对眼睛有什么好处| 意念是什么意思| 劳改犯是什么意思| 脑梗适合吃什么食物| 成都机场叫什么名字| 中耳炎用什么药最好| 细菌感染发烧吃什么药| 送父亲什么礼物好| 燕窝什么时候吃好| 前列腺增生有什么症状| 扁平疣是什么引起的| 头疼恶心是什么症状| 早餐适合吃什么| 蛋白石是什么| 卧蚕是什么意思| 心里想的话用什么标点符号| 什么药溶血栓最好| 百度

用车多项实用的汽车保养技巧 让您的维护更省

百度 但是,在把握世界的确定性和普遍必然性诉求上,思考起点的不同则呈现出了截然不同的理论图景。

Validated on 4 Dec 2020 ? Last edited on 23 Jan 2025

DigitalOcean Kubernetes (DOKS) is a Kubernetes service with a fully managed control plane, high availability, and autoscaling. DOKS integrates with standard Kubernetes toolchains and DigitalOcean’s load balancers, volumes, CPU and GPU Droplets, API, and CLI.

You can create continuous integration and continuous deployment (CI/CD) workflows with DigitalOcean services using GitHub Actions. In this topic, you learn how to deploy a basic Python application to a DigitalOcean Kubernetes cluster whenever you commit a change to your GitHub repository.

The workflow consists of the following steps:

  1. Create your workflow file

  2. Define your workflow actions

  3. Run your workflow

Prerequisites

Before you can create a CI/CD workflow using DigitalOcean services:

Create Your Workflow File

In your GitHub repository, click Actions. You can choose one of the provided templates to create a workflow. For this example, we will set up the workflow by clicking set up a workflow yourself.

Create workflow yaml

This creates a template YAML file in the .gitub/workflows folder. Rename the main.yml file to workflow.yml.

Configure Actions in Your Workflow

In the workflow.yml file, configure the following actions for your workflow:

  1. Specify events that trigger workflow
  2. Create workflow run
  3. Specify steps in job

For more information on the syntax to write the actions, see Workflow syntax for GitHub Actions.

Specify Events that Trigger Workflow

In the first section of the workflow.yml file, specify the conditions under which the workflow gets triggered. In this example, the workflow is triggered on a push to the main branch of the repository if specific files or folders are changed.

on:
  push:
    branches:
      - main
    paths:
      - 'config/**'
      - 'server.py'
      - 'Dockerfile'
      - '.github/workflows/**'

The on keyword specifies the name of the GitHub event which triggers the workflow, which is push in this case. You specify the configuration for the push event using the following keywords:

  • branches – The workflow triggers only on a push to the main branch.
  • paths – The workflow triggers when there is a change in server.py, Dockerfile, the deployment YAML file in config folder or the workflow YAML file in the workflow folder in the repository.

Create Workflow Run

A workflow run is made up of one or more jobs that can run sequentially or in parallel. It specifies the type of machine where the job runs and several steps to represent a sequence of tasks that will be executed as part of the job. These are specified using the runs-on and steps keywords. For this example, we write a single build job.

jobs:
 build:
   runs-on: ubuntu-latest
   steps:
   ....

Specify Steps in Job

A step is an individual task that can run commands in a job. A step has a uses or a run keyword to run an action or a shell command, and optionally a name keyword. The build job in this example performs the following steps:

  1. Checks out your repository under $GITHUB_WORKSPACE so that the job can access it.
steps:
- name: Checkout master
  uses: actions/checkout@main

$GITHUB_WORKSPACE is one of the environment variables in the Action’s runtime environment. This directory contains a copy of the repository that triggered the workflow. Changes made here persist from one step to the next.

  1. Installs the doctl command-line client using DigitalOcean doctl Action.
    This action enables you to interact with DigitalOcean services. It uses DIGITALOCEAN_ACCESS_TOKEN you added as a GitHub secret as a prerequisite.
- name: Install doctl
  uses: digitalocean/action-doctl@v2
  with:
    token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

doctl is now available in the virtual environment and can be used directly in the following steps.

  1. Builds the Docker image and pushes it to your container registry.
- name: Build container image
  run: docker build -t registry.digitalocean.com/<registry-name>/<repository_name>:$(echo $GITHUB_SHA | head -c7) .

- name: Log in to DigitalOcean Container Registry with short-lived credentials
  run: doctl registry login --expiry-seconds 1200

- name: Push image to DigitalOcean Container Registry
  run: docker push registry.digitalocean.com/<registry-name>/<repository_name>:$(echo $GITHUB_SHA | head -c7)

We build the Docker image with the $GITHUB_SHA tag, which is another environment variable in the Action’s runtime environment. Its value is the SHA of the commit that triggered the workflow. To build and push your image, specify the name of your registry and repository in the commands.

Before we can push the tagged image, we log in to the container registry. We pass the --expiry-seconds flag to generate temporary, short-lived credentials that will be revoked when the job is complete. We then push the tagged image to the container registry.

  1. Deploys to your DigitalOcean Kubernetes cluster.
- name: Update deployment file
  run: TAG=$(echo $GITHUB_SHA | head -c7) && sed -i 's|<IMAGE>|registry.digitalocean.com/<registry-name>/<repository_name>:'${TAG}'|' $GITHUB_WORKSPACE/config/deployment.yml

- name: Save DigitalOcean kubeconfig with short-lived credentials
  run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 <cluster-name>

- name: Deploy to DigitalOcean Kubernetes
  run: kubectl apply -f $GITHUB_WORKSPACE/config/deployment.yml

- name: Verify deployment
  run: kubectl rollout status deployment/<deployment_name>

We provide a deployment.yml file that only has a placeholder for the Docker image, IMAGE, we want to deploy. Before we can deploy the image to the DigitalOcean Kubernetes cluster, we need to update it to point to the image we tagged and pushed to the container registry. To do this, we use the standard UNIX tools and sed to update the contents of our deployment file.

Then, we add the credentials for the cluster we integrated with the registry, <cluster-name>, as a prerequisite to a local kubeconfig file, deploy to the cluster and verify the deployment. <deployment_name> is the name of the deployment specified in the deployment.yml file.

To deploy to your cluster, specify the name of your registry, repository and cluster integrated with your registry in the commands.

Run Your Workflow

Once you complete configuring the steps for your workflow run in the workflow.yml file, add a commit message and commit the changes to your GitHub repository. This commit triggers the workflow. Each step runs in the order specified in the workflow.

You can monitor the progress of the workflow run by clicking All workflows and selecting the name of the workflow in the Actions tab. Under Jobs, click build.

Click to expand a step and view the results of that step.

GitHub Actions progress

Once everything is green, your application is live at http://<external-endpoint>, where external-endpoint is the External Endpoint of the service that you can obtain from the Kubernetes dashboard of your cluster.

Next Steps

You can expose your deployment to the world by adding a load balancer as described in Add Load Balancers.

Any time you make a change to your app and push a commit to the main branch of your GitHub repository, the GitHub Actions workflow triggers and your changes get re-deployed.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.

炒菜什么时候放调料 7年之痒是什么意思 紫苏有什么功效与作用 山竹什么样的好 双规是什么
花生死苗烂根用什么药 月办念什么 巨蟹男和什么星座最配 三天不打上房揭瓦的下一句是什么 字帖是什么
87年属什么的 小孩呕吐吃什么药 什么叫做流年 孕妇子痫是什么病 olayks是什么牌子
子宫肌瘤做什么检查能查出来 辛弃疾字什么 春风得意是什么生肖 腿上紫色血丝什么原因 乏力是什么感觉
并蒂是什么意思hcv7jop9ns2r.cn 香菜不能和什么一起吃xjhesheng.com 鸡胸是什么原因引起的hcv8jop6ns9r.cn 胰岛素ins是什么意思hcv8jop3ns7r.cn 什么颜色属金hcv8jop5ns8r.cn
1972年属鼠的是什么命hcv8jop6ns3r.cn 少田宅痣是什么意思hcv9jop6ns6r.cn 福建岩茶属于什么茶hcv9jop7ns2r.cn pes是什么材料hcv7jop6ns1r.cn 恶心头晕是什么症状hcv7jop5ns3r.cn
91年的属什么生肖hcv8jop7ns5r.cn 记号笔用什么能擦掉hcv9jop3ns4r.cn 眼睛模糊用什么眼药水hcv8jop3ns8r.cn 牙疼喝什么药xscnpatent.com 上火吃什么水果降火快hcv7jop9ns4r.cn
潘驴邓小闲是什么意思hcv8jop2ns6r.cn 虾为什么叫对虾hcv8jop1ns9r.cn 钙是什么hcv9jop5ns7r.cn 沙参长什么样子图片hcv7jop9ns6r.cn 学前教育学什么helloaicloud.com
百度