update APIs in v1.16

pull/741/head
gjmzj 2019-11-03 12:32:10 +00:00
parent 30c5c0566c
commit 2ff5d55d6d
39 changed files with 52 additions and 76 deletions

View File

@ -21,7 +21,7 @@ data:
type: kubernetes.io/dockerconfigjson type: kubernetes.io/dockerconfigjson
--- ---
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: APP_NAME name: APP_NAME

View File

@ -53,7 +53,7 @@ speaker-n79l4 1/1 Running 0 4h
``` bash ``` bash
# 创建测试应用 # 创建测试应用
$ cat > test-nginx.yaml << EOF $ cat > test-nginx.yaml << EOF
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: nginx3 name: nginx3

View File

@ -2,7 +2,6 @@
`Network Policy`提供了基于策略的网络控制,用于隔离应用并减少攻击面。它使用标签选择器模拟传统的分段网络,并通过策略控制它们之间的流量以及来自外部的流量;目前基于`linux iptables`实现,使用类似`nf_conntrack`检查记录网络流量`session`从而决定流量是否阻断;因此它是`状态检测防火墙`。 `Network Policy`提供了基于策略的网络控制,用于隔离应用并减少攻击面。它使用标签选择器模拟传统的分段网络,并通过策略控制它们之间的流量以及来自外部的流量;目前基于`linux iptables`实现,使用类似`nf_conntrack`检查记录网络流量`session`从而决定流量是否阻断;因此它是`状态检测防火墙`。
- `k8s v1.7`版本以后Network Policy已经默认可用`v1.6`以及之前版本需要在kube-apiserver中开启extensions/v1beta1/networkpolicies
- 网络插件要支持 Network Policy如 Calico、Romana、Weave Net - 网络插件要支持 Network Policy如 Calico、Romana、Weave Net
### 简单示例 ### 简单示例

View File

@ -87,7 +87,7 @@ k8s精确地控制着整个发布过程分批次有序地进行着滚动更
如果未指定这两个可选参数则k8s会使用默认配置 如果未指定这两个可选参数则k8s会使用默认配置
``` bash ``` bash
root@kube-aio:~# kubectl get deploy busy -o yaml root@kube-aio:~# kubectl get deploy busy -o yaml
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
annotations: annotations:
@ -99,7 +99,6 @@ metadata:
name: busy name: busy
namespace: default namespace: default
resourceVersion: "199461" resourceVersion: "199461"
selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/busy
uid: 93fde307-a359-11e8-a93b-525400c61543 uid: 93fde307-a359-11e8-a93b-525400c61543
spec: spec:
progressDeadlineSeconds: 600 progressDeadlineSeconds: 600

View File

@ -89,7 +89,7 @@ RUN sed -i 's/^JAVA_OPTS=.*webresources\"$/JAVA_OPTS=\"$JAVA_OPTS -Djava.protoco
``` ```
--- ---
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: TemplateProject name: TemplateProject

View File

@ -41,7 +41,7 @@ subjects:
namespace: kube-system namespace: kube-system
--- ---
kind: Deployment kind: Deployment
apiVersion: apps/v1beta1 apiVersion: apps/v1
metadata: metadata:
labels: labels:
k8s-app: kubernetes-dashboard k8s-app: kubernetes-dashboard

View File

@ -70,7 +70,6 @@ spec:
# supports critical pod annotation based priority scheme. # supports critical pod annotation based priority scheme.
# Note that this does not guarantee admission on the nodes (#40573). # Note that this does not guarantee admission on the nodes (#40573).
annotations: annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
seccomp.security.alpha.kubernetes.io/pod: 'docker/default' seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec: spec:
priorityClassName: system-node-critical priorityClassName: system-node-critical

View File

@ -175,7 +175,7 @@ Create StorageClass for SSD-PD
``` ```
$ kubectl create -f - <<EOF $ kubectl create -f - <<EOF
kind: StorageClass kind: StorageClass
apiVersion: extensions/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: ssd name: ssd
provisioner: kubernetes.io/gce-pd provisioner: kubernetes.io/gce-pd

View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:

View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
labels: labels:

View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
labels: labels:

View File

@ -1,5 +1,5 @@
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: monitoring-grafana name: monitoring-grafana

View File

@ -20,7 +20,7 @@ roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: heapster name: heapster

View File

@ -1,5 +1,5 @@
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: monitoring-influxdb name: monitoring-influxdb

View File

@ -1,5 +1,5 @@
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: monitoring-influxdb name: monitoring-influxdb

View File

@ -1,5 +1,5 @@
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: monitoring-influxdb name: monitoring-influxdb

View File

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "jenkins.fullname" . }} name: {{ template "jenkins.fullname" . }}

View File

@ -128,7 +128,7 @@ Master:
PodAnnotations: {} PodAnnotations: {}
Ingress: Ingress:
ApiVersion: extensions/v1beta1 ApiVersion: networking.k8s.io/v1beta1
Annotations: Annotations:
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"
@ -196,9 +196,8 @@ Persistence:
NetworkPolicy: NetworkPolicy:
# Enable creation of NetworkPolicy resources. # Enable creation of NetworkPolicy resources.
Enabled: false Enabled: false
# For Kubernetes v1.4, v1.5 and v1.6, use 'extensions/v1beta1'
# For Kubernetes v1.7, use 'networking.k8s.io/v1' # For Kubernetes v1.7, use 'networking.k8s.io/v1'
ApiVersion: extensions/v1beta1 ApiVersion: networking.k8s.io/v1
## Install Default RBAC roles and bindings ## Install Default RBAC roles and bindings
rbac: rbac:

View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ template "master.fullname" . }} name: {{ template "master.fullname" . }}

View File

@ -1,5 +1,5 @@
{{- if .Values.replication.enabled }} {{- if .Values.replication.enabled }}
apiVersion: apps/v1beta1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ template "slave.fullname" . }} name: {{ template "slave.fullname" . }}

View File

@ -1,5 +1,5 @@
--- ---
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:

View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "grafana.fullname" . }} name: {{ template "grafana.fullname" . }}

View File

@ -1,5 +1,5 @@
{{- if .Values.rbac.pspEnabled }} {{- if .Values.rbac.pspEnabled }}
apiVersion: extensions/v1beta1 apiVersion: policy/v1beta1
kind: PodSecurityPolicy kind: PodSecurityPolicy
metadata: metadata:
name: {{ template "grafana.fullname" . }} name: {{ template "grafana.fullname" . }}

View File

@ -1,5 +1,5 @@
{{- if .Values.alertmanager.enabled -}} {{- if .Values.alertmanager.enabled -}}
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:

View File

@ -1,5 +1,5 @@
{{- if .Values.kubeStateMetrics.enabled -}} {{- if .Values.kubeStateMetrics.enabled -}}
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
{{- if .Values.kubeStateMetrics.deploymentAnnotations }} {{- if .Values.kubeStateMetrics.deploymentAnnotations }}

View File

@ -1,5 +1,5 @@
{{- if .Values.nodeExporter.enabled -}} {{- if .Values.nodeExporter.enabled -}}
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
{{- if .Values.nodeExporter.deploymentAnnotations }} {{- if .Values.nodeExporter.deploymentAnnotations }}

View File

@ -1,5 +1,5 @@
{{- if .Values.pushgateway.enabled -}} {{- if .Values.pushgateway.enabled -}}
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:

View File

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
{{- if .Values.server.deploymentAnnotations }} {{- if .Values.server.deploymentAnnotations }}

View File

@ -69,7 +69,7 @@ data:
# as the Calico CNI plugins and network config on # as the Calico CNI plugins and network config on
# each master and worker node in a Kubernetes cluster. # each master and worker node in a Kubernetes cluster.
kind: DaemonSet kind: DaemonSet
apiVersion: extensions/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: calico-node name: calico-node
namespace: kube-system namespace: kube-system
@ -87,13 +87,8 @@ spec:
metadata: metadata:
labels: labels:
k8s-app: calico-node k8s-app: calico-node
annotations:
# This, along with the CriticalAddonsOnly toleration below,
# marks the pod as a critical add-on, ensuring it gets
# priority scheduling and that its resources are reserved
# if it ever gets evicted.
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
hostNetwork: true hostNetwork: true
@ -294,15 +289,13 @@ metadata:
# This manifest deploys the Calico Kubernetes controllers. # This manifest deploys the Calico Kubernetes controllers.
# See https://github.com/projectcalico/kube-controllers # See https://github.com/projectcalico/kube-controllers
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: calico-kube-controllers name: calico-kube-controllers
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
# The controllers can only have a single active instance. # The controllers can only have a single active instance.
replicas: 1 replicas: 1
@ -318,6 +311,7 @@ spec:
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
# The controllers must run in the host network namespace so that # The controllers must run in the host network namespace so that

View File

@ -69,7 +69,7 @@ data:
# as the Calico CNI plugins and network config on # as the Calico CNI plugins and network config on
# each master and worker node in a Kubernetes cluster. # each master and worker node in a Kubernetes cluster.
kind: DaemonSet kind: DaemonSet
apiVersion: extensions/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: calico-node name: calico-node
namespace: kube-system namespace: kube-system
@ -87,13 +87,8 @@ spec:
metadata: metadata:
labels: labels:
k8s-app: calico-node k8s-app: calico-node
annotations:
# This, along with the CriticalAddonsOnly toleration below,
# marks the pod as a critical add-on, ensuring it gets
# priority scheduling and that its resources are reserved
# if it ever gets evicted.
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
hostNetwork: true hostNetwork: true
@ -303,15 +298,13 @@ metadata:
# This manifest deploys the Calico Kubernetes controllers. # This manifest deploys the Calico Kubernetes controllers.
# See https://github.com/projectcalico/kube-controllers # See https://github.com/projectcalico/kube-controllers
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: calico-kube-controllers name: calico-kube-controllers
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
# The controllers can only have a single active instance. # The controllers can only have a single active instance.
replicas: 1 replicas: 1
@ -327,6 +320,7 @@ spec:
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
# The controllers must run in the host network namespace so that # The controllers must run in the host network namespace so that

View File

@ -69,7 +69,7 @@ data:
# as the Calico CNI plugins and network config on # as the Calico CNI plugins and network config on
# each master and worker node in a Kubernetes cluster. # each master and worker node in a Kubernetes cluster.
kind: DaemonSet kind: DaemonSet
apiVersion: extensions/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: calico-node name: calico-node
namespace: kube-system namespace: kube-system
@ -87,13 +87,8 @@ spec:
metadata: metadata:
labels: labels:
k8s-app: calico-node k8s-app: calico-node
annotations:
# This, along with the CriticalAddonsOnly toleration below,
# marks the pod as a critical add-on, ensuring it gets
# priority scheduling and that its resources are reserved
# if it ever gets evicted.
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
hostNetwork: true hostNetwork: true
@ -307,15 +302,13 @@ metadata:
# This manifest deploys the Calico Kubernetes controllers. # This manifest deploys the Calico Kubernetes controllers.
# See https://github.com/projectcalico/kube-controllers # See https://github.com/projectcalico/kube-controllers
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: calico-kube-controllers name: calico-kube-controllers
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
# The controllers can only have a single active instance. # The controllers can only have a single active instance.
replicas: 1 replicas: 1
@ -331,6 +324,7 @@ spec:
labels: labels:
k8s-app: calico-kube-controllers k8s-app: calico-kube-controllers
spec: spec:
priorityClassName: system-cluster-critical
nodeSelector: nodeSelector:
beta.kubernetes.io/os: linux beta.kubernetes.io/os: linux
# The controllers must run in the host network namespace so that # The controllers must run in the host network namespace so that

View File

@ -11,7 +11,7 @@ spec:
org: empire org: empire
class: deathstar class: deathstar
--- ---
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: deathstar name: deathstar

View File

@ -159,7 +159,7 @@ data:
# [1] http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action # [1] http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action
tofqdns-enable-poller: "false" tofqdns-enable-poller: "false"
--- ---
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
labels: labels:
@ -181,12 +181,12 @@ spec:
# cilium to be a critical pod in the cluster, which ensures cilium # cilium to be a critical pod in the cluster, which ensures cilium
# gets priority scheduling. # gets priority scheduling.
# https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ # https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
scheduler.alpha.kubernetes.io/critical-pod: ""
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]' scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]'
labels: labels:
k8s-app: cilium k8s-app: cilium
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
spec: spec:
priorityClassName: system-cluster-critical
containers: containers:
- args: - args:
- --debug=$(CILIUM_DEBUG) - --debug=$(CILIUM_DEBUG)
@ -502,7 +502,7 @@ spec:
maxUnavailable: 2 maxUnavailable: 2
type: RollingUpdate type: RollingUpdate
--- ---
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
@ -830,7 +830,7 @@ metadata:
name: cilium-etcd-sa name: cilium-etcd-sa
namespace: kube-system namespace: kube-system
--- ---
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:

View File

@ -66,9 +66,8 @@ spec:
metadata: metadata:
labels: labels:
k8s-app: kube-dns k8s-app: kube-dns
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-cluster-critical
tolerations: tolerations:
- key: "CriticalAddonsOnly" - key: "CriticalAddonsOnly"
operator: "Exists" operator: "Exists"

View File

@ -115,7 +115,7 @@ roleRef:
kind: Role kind: Role
name: config-watcher name: config-watcher
--- ---
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
namespace: metallb-system namespace: metallb-system
@ -172,7 +172,7 @@ spec:
- net_raw - net_raw
--- ---
apiVersion: apps/v1beta2 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
namespace: metallb-system namespace: metallb-system

View File

@ -68,7 +68,7 @@ roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
--- ---
kind: Deployment kind: Deployment
apiVersion: extensions/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: alicloud-disk-controller name: alicloud-disk-controller
namespace: kube-system namespace: kube-system

View File

@ -42,7 +42,7 @@ roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
--- ---
kind: Deployment kind: Deployment
apiVersion: apps/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: {{ storage.aliyun_nas.controller_name }} name: {{ storage.aliyun_nas.controller_name }}
namespace: kube-system namespace: kube-system

View File

@ -39,7 +39,7 @@ roleRef:
--- ---
kind: Deployment kind: Deployment
apiVersion: apps/v1beta1 apiVersion: apps/v1
metadata: metadata:
name: {{ storage.nfs.provisioner_name }} name: {{ storage.nfs.provisioner_name }}
namespace: kube-system namespace: kube-system

View File

@ -25,7 +25,7 @@ data:
} }
--- ---
apiVersion: extensions/v1beta1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
labels: labels:
@ -39,9 +39,8 @@ spec:
labels: labels:
k8s-app: kube-router k8s-app: kube-router
tier: node tier: node
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
priorityClassName: system-cluster-critical
serviceAccountName: kube-router serviceAccountName: kube-router
containers: containers:
- name: kube-router - name: kube-router