/logo_transparent.png

蜷缩的蜗牛

专注云原生运维|

Istio Ambient 模式使用

下载 Ambient Mesh 预览版

1
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.18.0-alpha.0 TARGET_ARCH=x86_64 sh -

利用 kind 创建 k8s 集群

1
2
3
4
5
6
7
8
9
kind create cluster --config=- <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: ambient
nodes:
- role: control-plane
- role: worker
- role: worker
EOF

注意 kind 安装的 k8s 版本大于等于 1.23

Istio Proxy Access 日志

开启 Access 日志

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
apiVersion: v1
kind: ConfigMap
metadata:
  name: istio
  namespace: istio-system
data:
  mesh: |
    accessLogEncoding: JSON
    accessLogFile: /dev/stdout
    accessLogFormat: ""

SLA 和运维指标

1,SLA SLA 是 Service-Level Agreement 的缩写,意思是服务等级协议,一般是协议双方做的彼此承诺,放在运维的领域,很重要的一个结果指标就是系统的 SLA,这个是技术向业务做的一个承诺。 系统 SLA 的定制方法一般有两种,一种是通过时间维度进行测算,另外一种是通过用户请求状态进行测算。

OpenEBS-CStor 使用指南

CStor 存储策略

目标节点 nodeSelector

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cat << EOF | kubectl apply -f -
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  target:
    nodeSelector:
      biz.type: test
EOF

目标节点亲和行 affinity

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  target:
    affinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: openebs.io/target-affinity
            operator: In
            values:
            - fio-cstor                              // application-unique-label
        topologyKey: kubernetes.io/hostname
        namespaces: ["default"]

目标节点资源限制 resources

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  target:
    resources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"
    auxResources:
      requests:
        memory: "64Mi"
        cpu: "250m"
      limits:
        memory: "128Mi"
        cpu: "500m"

目标节点污点 tolerations

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
apiVersion: cstor.openebs.io/v1
kind: CStorVolumePolicy
metadata:
  name: csi-volume-policy
  namespace: openebs
spec:
  replica: {}
  target:
    tolerations:
    - key: "key1"
      operator: "Equal"
      value: "value1"
      effect: "NoSchedule"

深入 Istio 系列 - Sidecar 配置模板

本文不讲源码,来说说 istio sidecar 配置,从而灵活的控制 sidecar 注入、资源修改等场景。

1
kubectl get cm -n istio-system istio-sidecar-injector -o yaml

先来预览一下 istio-sidecar-injector,主要包含 config 和 values 20230224165755

config

可以看到配置项有 默认模板 defaultTemplates、注入策略 policy、注入选择器 alwaysInjectSelector、 永不注入选择器 neverInjectSelectorinjectedAnnotations 和 模板内容 templates

关于注入策略 (policy)、注入选择器 (alwaysInjectSelector、neverInjectSelector) 和注入注解 (injectedAnnotations) 可以查看 Sidecar 自动注入 本文主要来了解 Sidecar 注入的模板,方便后续需要针对 Sidecar 的部署调整

0%