mirror of https://github.com/easzlab/kubeasz.git
update APIs in v1.16
parent
30c5c0566c
commit
2ff5d55d6d
|
@ -21,7 +21,7 @@ data:
|
|||
type: kubernetes.io/dockerconfigjson
|
||||
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: APP_NAME
|
||||
|
|
|
@ -53,7 +53,7 @@ speaker-n79l4 1/1 Running 0 4h
|
|||
``` bash
|
||||
# 创建测试应用
|
||||
$ cat > test-nginx.yaml << EOF
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx3
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
`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
|
||||
|
||||
### 简单示例
|
||||
|
|
|
@ -87,7 +87,7 @@ k8s精确地控制着整个发布过程,分批次有序地进行着滚动更
|
|||
如果未指定这两个可选参数,则k8s会使用默认配置:
|
||||
``` bash
|
||||
root@kube-aio:~# kubectl get deploy busy -o yaml
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
|
@ -99,7 +99,6 @@ metadata:
|
|||
name: busy
|
||||
namespace: default
|
||||
resourceVersion: "199461"
|
||||
selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/busy
|
||||
uid: 93fde307-a359-11e8-a93b-525400c61543
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
|
|
|
@ -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
|
||||
metadata:
|
||||
name: TemplateProject
|
||||
|
|
|
@ -41,7 +41,7 @@ subjects:
|
|||
namespace: kube-system
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: kubernetes-dashboard
|
||||
|
|
|
@ -70,7 +70,6 @@ spec:
|
|||
# supports critical pod annotation based priority scheme.
|
||||
# Note that this does not guarantee admission on the nodes (#40573).
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
|
||||
spec:
|
||||
priorityClassName: system-node-critical
|
||||
|
|
|
@ -175,7 +175,7 @@ Create StorageClass for SSD-PD
|
|||
```
|
||||
$ kubectl create -f - <<EOF
|
||||
kind: StorageClass
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: ssd
|
||||
provisioner: kubernetes.io/gce-pd
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: monitoring-grafana
|
||||
|
|
|
@ -20,7 +20,7 @@ roleRef:
|
|||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: heapster
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: monitoring-influxdb
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: monitoring-influxdb
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: monitoring-influxdb
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "jenkins.fullname" . }}
|
||||
|
|
|
@ -128,7 +128,7 @@ Master:
|
|||
PodAnnotations: {}
|
||||
|
||||
Ingress:
|
||||
ApiVersion: extensions/v1beta1
|
||||
ApiVersion: networking.k8s.io/v1beta1
|
||||
Annotations:
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
|
@ -196,9 +196,8 @@ Persistence:
|
|||
NetworkPolicy:
|
||||
# Enable creation of NetworkPolicy resources.
|
||||
Enabled: false
|
||||
# For Kubernetes v1.4, v1.5 and v1.6, use 'extensions/v1beta1'
|
||||
# For Kubernetes v1.7, use 'networking.k8s.io/v1'
|
||||
ApiVersion: extensions/v1beta1
|
||||
ApiVersion: networking.k8s.io/v1
|
||||
|
||||
## Install Default RBAC roles and bindings
|
||||
rbac:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ template "master.fullname" . }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.replication.enabled }}
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ template "slave.fullname" . }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.rbac.pspEnabled }}
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodSecurityPolicy
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.alertmanager.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.kubeStateMetrics.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- if .Values.kubeStateMetrics.deploymentAnnotations }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.nodeExporter.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
{{- if .Values.nodeExporter.deploymentAnnotations }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.pushgateway.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- if .Values.server.deploymentAnnotations }}
|
||||
|
|
|
@ -69,7 +69,7 @@ data:
|
|||
# as the Calico CNI plugins and network config on
|
||||
# each master and worker node in a Kubernetes cluster.
|
||||
kind: DaemonSet
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: calico-node
|
||||
namespace: kube-system
|
||||
|
@ -87,13 +87,8 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
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:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
hostNetwork: true
|
||||
|
@ -294,15 +289,13 @@ metadata:
|
|||
|
||||
# This manifest deploys the Calico Kubernetes controllers.
|
||||
# See https://github.com/projectcalico/kube-controllers
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: calico-kube-controllers
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
# The controllers can only have a single active instance.
|
||||
replicas: 1
|
||||
|
@ -318,6 +311,7 @@ spec:
|
|||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
# The controllers must run in the host network namespace so that
|
||||
|
|
|
@ -69,7 +69,7 @@ data:
|
|||
# as the Calico CNI plugins and network config on
|
||||
# each master and worker node in a Kubernetes cluster.
|
||||
kind: DaemonSet
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: calico-node
|
||||
namespace: kube-system
|
||||
|
@ -87,13 +87,8 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
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:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
hostNetwork: true
|
||||
|
@ -303,15 +298,13 @@ metadata:
|
|||
|
||||
# This manifest deploys the Calico Kubernetes controllers.
|
||||
# See https://github.com/projectcalico/kube-controllers
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: calico-kube-controllers
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
# The controllers can only have a single active instance.
|
||||
replicas: 1
|
||||
|
@ -327,6 +320,7 @@ spec:
|
|||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
# The controllers must run in the host network namespace so that
|
||||
|
|
|
@ -69,7 +69,7 @@ data:
|
|||
# as the Calico CNI plugins and network config on
|
||||
# each master and worker node in a Kubernetes cluster.
|
||||
kind: DaemonSet
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: calico-node
|
||||
namespace: kube-system
|
||||
|
@ -87,13 +87,8 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
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:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
hostNetwork: true
|
||||
|
@ -307,15 +302,13 @@ metadata:
|
|||
|
||||
# This manifest deploys the Calico Kubernetes controllers.
|
||||
# See https://github.com/projectcalico/kube-controllers
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: calico-kube-controllers
|
||||
namespace: kube-system
|
||||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
# The controllers can only have a single active instance.
|
||||
replicas: 1
|
||||
|
@ -331,6 +324,7 @@ spec:
|
|||
labels:
|
||||
k8s-app: calico-kube-controllers
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
# The controllers must run in the host network namespace so that
|
||||
|
|
|
@ -11,7 +11,7 @@ spec:
|
|||
org: empire
|
||||
class: deathstar
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: deathstar
|
||||
|
|
|
@ -159,7 +159,7 @@ data:
|
|||
# [1] http://docs.cilium.io/en/stable/install/upgrade/#changes-that-may-require-action
|
||||
tofqdns-enable-poller: "false"
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
|
@ -181,12 +181,12 @@ spec:
|
|||
# cilium to be a critical pod in the cluster, which ensures cilium
|
||||
# gets priority scheduling.
|
||||
# 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"}]'
|
||||
labels:
|
||||
k8s-app: cilium
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
containers:
|
||||
- args:
|
||||
- --debug=$(CILIUM_DEBUG)
|
||||
|
@ -502,7 +502,7 @@ spec:
|
|||
maxUnavailable: 2
|
||||
type: RollingUpdate
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
@ -830,7 +830,7 @@ metadata:
|
|||
name: cilium-etcd-sa
|
||||
namespace: kube-system
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
|
|
|
@ -66,9 +66,8 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
tolerations:
|
||||
- key: "CriticalAddonsOnly"
|
||||
operator: "Exists"
|
||||
|
|
|
@ -115,7 +115,7 @@ roleRef:
|
|||
kind: Role
|
||||
name: config-watcher
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
namespace: metallb-system
|
||||
|
@ -172,7 +172,7 @@ spec:
|
|||
- net_raw
|
||||
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: metallb-system
|
||||
|
|
|
@ -68,7 +68,7 @@ roleRef:
|
|||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: alicloud-disk-controller
|
||||
namespace: kube-system
|
||||
|
|
|
@ -42,7 +42,7 @@ roleRef:
|
|||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: {{ storage.aliyun_nas.controller_name }}
|
||||
namespace: kube-system
|
||||
|
|
|
@ -39,7 +39,7 @@ roleRef:
|
|||
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: {{ storage.nfs.provisioner_name }}
|
||||
namespace: kube-system
|
||||
|
|
|
@ -25,7 +25,7 @@ data:
|
|||
}
|
||||
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
|
@ -39,9 +39,8 @@ spec:
|
|||
labels:
|
||||
k8s-app: kube-router
|
||||
tier: node
|
||||
annotations:
|
||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
serviceAccountName: kube-router
|
||||
containers:
|
||||
- name: kube-router
|
||||
|
|
Loading…
Reference in New Issue