Gitlab AutoDevop部署-更改名称工作负载和容器

时间:2020-02-06 08:34:17

标签: kubernetes gitlab-ci workload

我正在使用autodevops或gitlab ci(它们使用来自autodevops的自动部署)。除了部署时,工作负载的名称是生产用负载,除此之外,我想更改名称,因为我想拥有多个网站。

我试图这样更改名称:

  environment:
    name: nameofmyproject

但是在部署之后,网站返回了503服务暂时不可用

你有个主意吗?

我的gitlab和工作负载kubernetes:

enter image description here

我的gitlab ci

image: alpine:latest

variables:
  # KUBE_INGRESS_BASE_DOMAIN is the application deployment domain and should be set as a variable at the group or project level.
  # KUBE_INGRESS_BASE_DOMAIN: domain.example.com

  DISABLE_POSTGRES: "yes"
  POSTGRES_USER: user
  POSTGRES_PASSWORD: testing-password
  POSTGRES_ENABLED: "true"
  POSTGRES_DB: $CI_ENVIRONMENT_SLUG
  POSTGRES_VERSION: 9.6.2

  DOCKER_DRIVER: overlay2

  ROLLOUT_RESOURCE_TYPE: deployment

  DOCKER_TLS_CERTDIR: ""  # https://gitlab.com/gitlab-org/gitlab-runner/issues/4501

stages:
  - build
  - production

build:
  stage: build
  image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable"
  variables:
    DOCKER_TLS_CERTDIR: ""
  services:
    - docker:stable-dind
  script:
    - |
      if [[ -z "$CI_COMMIT_TAG" ]]; then
        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
      else
        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
      fi
    - /build/build.sh
  only:
    - branches
    - tags



.auto-deploy:
  image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.9.1"




.production: &production_template
  extends: .auto-deploy
  stage: production
  script:
    - auto-deploy check_kube_domain
    - auto-deploy download_chart
    - auto-deploy ensure_namespace
    - auto-deploy initialize_tiller
    - auto-deploy create_secret
    - auto-deploy deploy
    - auto-deploy delete canary
    - auto-deploy delete rollout
    - auto-deploy persist_environment_url

  environment:
    name: production
    url: http://$CI_PROJECT_PATH_SLUG.$KUBE_INGRESS_BASE_DOMAIN
  artifacts:
    paths: [environment_url.txt]

production:
  <<: *production_template
  only:
    refs:
      - master
    kubernetes: active

1 个答案:

答案 0 :(得分:0)

您可以设置变量import React from 'react'; import { IonInput, IonItem } from '@ionic/react'; const BasicInput: React.FC<{ id: string, placeholder: string, onChange: (newValue: string) => void }> = (props) => { return ( <IonItem> <IonInput placeholder={props.placeholder} onIonChange={(e) => props.onChange(e.target.value)} > </IonInput> </IonItem> ) } export default BasicInput; ADDITIONAL_HOSTS

相关问题