Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

《kubernetes进阶实战》堪误信息 #2

Open
iKubernetes opened this issue Apr 6, 2019 · 13 comments
Open

《kubernetes进阶实战》堪误信息 #2

iKubernetes opened this issue Apr 6, 2019 · 13 comments

Comments

@iKubernetes
Copy link
Owner

iKubernetes commented Apr 6, 2019

欢迎《kubernetes进阶实战》的读者朋友们在此处提交堪误信息!

@faryang-sh
Copy link

image

@faryang-sh
Copy link

image

@jiangwh
Copy link

jiangwh commented May 11, 2019

image

@mrhan1993
Copy link

mrhan1993 commented May 15, 2019

6.62章节,排版错误。应该在正文163页。(截图是微信读书购买的电子版,非D版)
图片

@lianghuiyuan
Copy link

lianghuiyuan commented Jun 27, 2019

<kubernetes进阶实战> 2019年1月第1版第1次印刷

  • 第2章 2.1.2 Controller P19
    书中描述多了一个DaemonSet控制器本身也是一种资源类型,它有着多种实现,其中与工作负载相关的实现如ReplicationController、Deployment、StatefulSet、DaemonSet、~~DaemonSet~~和Jobs等,也可统称他们为Pod控制器。……

  • 第7章 7.5.1 创建PV P187
    书中描述:下面的资源清单配置示例中定义了一个使用NFS存储后端的PV,空间大小为**10GB**,支持多路的读写操作。……
    但是YAML中PV创建的空间大小是5GB

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-nfs-0001
  labels:
    release: stable
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Recycle
  storageClassName: slow
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path:  "/webdata/htdocs"
    server: nfs.ikubernetes.io
  • 第7章 7.5.4 存储类 P192
    书中描述:“ 它定义了一个使用Gluster存储系统的存储类glusterfs,并通过**annotations**字段将其定义为默认的存储类:
    但是在glusterfs-storageclass.yaml文件中并没有annotations字段
    我认为这里是表述有误:annotations字段应该是用在定义PVC时将其使用的存储类默认为指定的存储类,但是我们本例中是定义存储类,这里不能通过annotations字段将其定义为默认的存储类。
    书中的glusterfs-storageclass.yaml文件:
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: gluster-dynamic
provisioner: kubernetes.io/glusterfs
parameters:
  resturl: "http://172.16.2.36:8080" 
  restauthenabled: "false"
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-with-pod-anti-affinity
spec:
  replicas: 4
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      name: myapp
      labels:
        app: myapp
    spec:
      affinity:
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - {key: app, operator: In, values: ["myapp"]}
            topologyKey: kubernetes.io/hostname
      containers:
      - name: myapp
        image: ikubernetes/myapp:v1

正确的应该为:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-with-pod-anti-affinity
spec:
  replicas: 4
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      name: myapp
      labels:
        app: myapp
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - {key: app, operator: In, values: ["myapp"]}
            topologyKey: kubernetes.io/hostname
      containers:
      - name: myapp
        image: ikubernetes/myapp:v1

@anxinyf
Copy link

anxinyf commented Aug 3, 2019

第七章 7.5.2创建PVC P189-190
文章中不少yaml内容排版有问题...
第一、描述:如果需要绑定此前创建的PV资源pv-rbd-0001,而pvc-rbd-0001.yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-rbd-0001
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 2Gi
  storageClassName: fast
  selector:
    matchLabels:
      release: "stable"

但是在P88中给出的 pv-rbd-0001.yaml 中既没有metadata.labels.release: "stable",也没有spec.storageClassName: fast,这样时无法绑定的,而且该pv-rbd-0001.yaml 排版也有问题。但是github中已经给出pv-rbd-0001.yaml,请注意!

第二、第七章 7.5.2P190 中一处描述为”persistentVolumeClain存储卷“ 应为”persistentVolumeClaim“

@magichan
Copy link

magichan commented Dec 8, 2019

版次: 2019年1月第1版第2次印刷
第九章 9.6 Operator 概述 p247-18

并接需回馈社区

这句话,应该是打错了。无论怎么读都不合逻辑。

@iKubernetes
Copy link
Owner Author

iKubernetes commented Dec 24, 2019 via email

@chuck6
Copy link

chuck6 commented Mar 24, 2020

<kubernetes进阶实战> 2019年1月第1版第1次印刷

  • 第2章 2.1.2 Controller P19
    书中描述多了一个DaemonSet控制器本身也是一种资源类型,它有着多种实现,其中与工作负载相关的实现如ReplicationController、Deployment、StatefulSet、DaemonSet、~~DaemonSet~~和Jobs等,也可统称他们为Pod控制器。……
  • 第7章 7.5.1 创建PV P187
    书中描述:下面的资源清单配置示例中定义了一个使用NFS存储后端的PV,空间大小为**10GB**,支持多路的读写操作。……
    但是YAML中PV创建的空间大小是5GB
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-nfs-0001
  labels:
    release: stable
spec:
  capacity:
    storage: 5Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Recycle
  storageClassName: slow
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path:  "/webdata/htdocs"
    server: nfs.ikubernetes.io
  • 第7章 7.5.4 存储类 P192
    书中描述:“ 它定义了一个使用Gluster存储系统的存储类glusterfs,并通过**annotations**字段将其定义为默认的存储类:
    但是在glusterfs-storageclass.yaml文件中并没有annotations字段
    我认为这里是表述有误:annotations字段应该是用在定义PVC时将其使用的存储类默认为指定的存储类,但是我们本例中是定义存储类,这里不能通过annotations字段将其定义为默认的存储类。
    书中的glusterfs-storageclass.yaml文件:
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: gluster-dynamic
provisioner: kubernetes.io/glusterfs
parameters:
  resturl: "http://172.16.2.36:8080" 
  restauthenabled: "false"
  • 第9章 9.1 StatefulSet概述 P227~231
    这一小节写的真是乱啊[手动笑哭表情]!
    #2 (comment)#2 (comment) 提出了里面的错误,我也认为书中错了。
  • 第12章 12.3.4 Pod反亲和性调度 P342
    创建反亲和性Pod对象时应该用podAntiAffinity,而不是podAffinity
    书中YAML为:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-with-pod-anti-affinity
spec:
  replicas: 4
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      name: myapp
      labels:
        app: myapp
    spec:
      affinity:
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - {key: app, operator: In, values: ["myapp"]}
            topologyKey: kubernetes.io/hostname
      containers:
      - name: myapp
        image: ikubernetes/myapp:v1

正确的应该为:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-with-pod-anti-affinity
spec:
  replicas: 4
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      name: myapp
      labels:
        app: myapp
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - {key: app, operator: In, values: ["myapp"]}
            topologyKey: kubernetes.io/hostname
      containers:
      - name: myapp
        image: ikubernetes/myapp:v1

哥们,你看书看的真细致啊,里面确实很多YAML格式的文件都有些问题。第9章的"Replicaset"应该是要写成"DeamonSet"吧,P230和P231中的

@slcnx
Copy link

slcnx commented Jun 4, 2020

在第119页, 最后一行至120页第一行,使用patch更改镜像标签正确结果:kubectl patch -f myapp-deploy.yaml -p '{"spec": {"template": {"spec": {"containers": [{"image": "ikubernetes/myapp:v2","name":"myapp"}]}}}}'

书中原文:'{"spec": {"containers": ["image" "ikubernetes/myapp:v2","name":"myapp"}}'

@slcnx
Copy link

slcnx commented Jun 5, 2020

第129页, kubectl get pods -l job-name=job-example -a
不存在--show-all或-a

@AGou-ops
Copy link

第4章P97上方的代码块command的最后一个参数应当是--metrics-brief,原文少了一个-

@imcco
Copy link

imcco commented Mar 28, 2021

p140 没有postStop钩子函数吧,这里打印错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests