未创建istio侧车 [英] istio side car is not created

查看:46
本文介绍了未创建istio侧车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们安装了istio,而没有启用侧面汽车,我想将其启用到新名称空间中的特定服务

we have istio installed without the side car enabled gloablly , and I want to enable it to specific service in a new namespace

我在部署中添加了以下内容:

I’ve added to my deployment the following:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: gow
  labels:
    app: gowspec:
  replicas: 2
  template:
    metadata:
      labels:
        app: gow
        tier: service
      annotations:
        sidecar.istio.io/inject: "true"

运行时

get namespace -L istio-injection我没有看到启用任何功能,所有内容都为空...

get namespace -L istio-injection I don’t see anything enabled , everything is empty…

我如何验证已创建边车?我没有看到任何新东西...

How can I verify that the side car is created ? I dont see anything new ...

推荐答案

您可以使用 istioctl kube-inject 做到这一点

You can use istioctl kube-inject to make that

kubectl create namespace asdd
istioctl kube-inject -f nginx.yaml | kubectl apply -f - 


nginx.yaml


nginx.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: asdd
  labels:
    app: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "True"
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80

结果:

nginx-deployment-55b6fb474b-77788   2/2     Running   0          5m36s
nginx-deployment-55b6fb474b-jrkqk   2/2     Running   0          5m36s

让我知道您是否还有其他问题.

Let me know if You have any more questions.

这篇关于未创建istio侧车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆