Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes Ingress Skaffold文件_Kubernetes_Yaml_Skaffold - Fatal编程技术网

Kubernetes Ingress Skaffold文件

Kubernetes Ingress Skaffold文件,kubernetes,yaml,skaffold,Kubernetes,Yaml,Skaffold,我正在尝试将入口添加到我的Kubernetes文档中。我能够添加ingres.yaml文件,并且有大量关于ingres.yaml的文档,但是我使用skaffold.yaml来处理Kubernetes部署的细节。我找不到任何关于为入口创建skaffold文件的文档。(这只是使用googleCloudBuild、BuildPack和minikube)我遇到的所有文档都是针对NGINX的 我的项目如下所示: kubernetes-manifests: --- frontend_service.depl

我正在尝试将入口添加到我的Kubernetes文档中。我能够添加ingres.yaml文件,并且有大量关于ingres.yaml的文档,但是我使用skaffold.yaml来处理Kubernetes部署的细节。我找不到任何关于为入口创建skaffold文件的文档。(这只是使用googleCloudBuild、BuildPack和minikube)我遇到的所有文档都是针对NGINX的

我的项目如下所示:

kubernetes-manifests:
--- frontend_service.deployment.yaml
--- frontend_service.service.yaml 
--- ingress.yaml
--- login_service.deployment.yaml
--- login_service.service.yaml
--- recipes_service.deployment.yaml
--- recipes_service.service.yaml
apiVersion: skaffold/v2beta4
kind: Config
build:
  tagPolicy:
    sha256: {}
  # defines where to find the code at build time and where to push the resulting image
  artifacts:
  - image: frontend-service
    context: src/frontend
  - image: login-service
    context: src/login
  - image: recipes-service
    context: src/recipes
# defines the Kubernetes manifests to deploy on each run
deploy:
  kubectl:
    manifests:
    - ./kubernetes-manifests/*.service.yaml
    - ./kubernetes-manifests/*.deployment.yaml
profiles:
# use the cloudbuild profile to build images using Google Cloud Build
- name: cloudbuild
  build:
    googleCloudBuild: {}
- name: buildpacks
  build:
    artifacts:
    - image: frontend-service
      context: src/frontend
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"
    - image: login-service
      context: src/login
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"
    - image: recipes-service
      context: src/recipes
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"
我当前的skaffold文件如下:

kubernetes-manifests:
--- frontend_service.deployment.yaml
--- frontend_service.service.yaml 
--- ingress.yaml
--- login_service.deployment.yaml
--- login_service.service.yaml
--- recipes_service.deployment.yaml
--- recipes_service.service.yaml
apiVersion: skaffold/v2beta4
kind: Config
build:
  tagPolicy:
    sha256: {}
  # defines where to find the code at build time and where to push the resulting image
  artifacts:
  - image: frontend-service
    context: src/frontend
  - image: login-service
    context: src/login
  - image: recipes-service
    context: src/recipes
# defines the Kubernetes manifests to deploy on each run
deploy:
  kubectl:
    manifests:
    - ./kubernetes-manifests/*.service.yaml
    - ./kubernetes-manifests/*.deployment.yaml
profiles:
# use the cloudbuild profile to build images using Google Cloud Build
- name: cloudbuild
  build:
    googleCloudBuild: {}
- name: buildpacks
  build:
    artifacts:
    - image: frontend-service
      context: src/frontend
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"
    - image: login-service
      context: src/login
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"
    - image: recipes-service
      context: src/recipes
      buildpack:
        builder: "gcr.io/buildpacks/builder:v1"

当前的skaffold文件不在ingress体系结构中部署,它使用后端和前端层。

ingress定义只是Kubernetes资源,因此您只需将您的
ingress.yaml
添加到要部署的清单中:

deploy:
  kubectl:
    manifests:
    - ./kubernetes-manifests/ingress.yaml
    - ./kubernetes-manifests/*.service.yaml
    - ./kubernetes-manifests/*.deployment.yaml

你能详细解释一下为什么云构建会被标记吗?我是skaffold的新手,不知道构建类型是否会改变配置(我在这个配置中使用谷歌云构建),但我现在会取消标记。