zh-trans: batch add examples/admin/ yaml files (#11464)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
a60038f02b
commit
13953625e4
@@ -0,0 +1,69 @@
|
|||||||
|
# This is an example of how to setup cloud-controller-manger as a Daemonset in your cluster.
|
||||||
|
# It assumes that your masters can run pods and has the role node-role.kubernetes.io/master
|
||||||
|
# Note that this Daemonset will not work straight out of the box for your cloud, this is
|
||||||
|
# meant to be a guideline.
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: cloud-controller-manager
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: system:cloud-controller-manager
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: cluster-admin
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: cloud-controller-manager
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
k8s-app: cloud-controller-manager
|
||||||
|
name: cloud-controller-manager
|
||||||
|
namespace: kube-system
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: cloud-controller-manager
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
k8s-app: cloud-controller-manager
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cloud-controller-manager
|
||||||
|
containers:
|
||||||
|
- name: cloud-controller-manager
|
||||||
|
# for in-tree providers we use k8s.gcr.io/cloud-controller-manager
|
||||||
|
# this can be replaced with any other image for out-of-tree providers
|
||||||
|
image: k8s.gcr.io/cloud-controller-manager:v1.8.0
|
||||||
|
command:
|
||||||
|
- /usr/local/bin/cloud-controller-manager
|
||||||
|
- --cloud-provider=<YOUR_CLOUD_PROVIDER> # Add your own cloud provider here!
|
||||||
|
- --leader-elect=true
|
||||||
|
- --use-service-account-credentials
|
||||||
|
# these flags will vary for every cloud provider
|
||||||
|
- --allocate-node-cidrs=true
|
||||||
|
- --configure-cloud-routes=true
|
||||||
|
- --cluster-cidr=172.17.0.0/16
|
||||||
|
tolerations:
|
||||||
|
# this is required so CCM can bootstrap itself
|
||||||
|
- key: node.cloudprovider.kubernetes.io/uninitialized
|
||||||
|
value: "true"
|
||||||
|
effect: NoSchedule
|
||||||
|
# this is to have the daemonset runnable on master nodes
|
||||||
|
# the taint may vary depending on your cluster setup
|
||||||
|
- key: node-role.kubernetes.io/master
|
||||||
|
effect: NoSchedule
|
||||||
|
# this is to restrict CCM to only run on master nodes
|
||||||
|
# the node selector may vary depending on your cluster setup
|
||||||
|
nodeSelector:
|
||||||
|
node-role.kubernetes.io/master: ""
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
kind: InitializerConfiguration
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1alpha1
|
||||||
|
metadata:
|
||||||
|
name: pvlabel.kubernetes.io
|
||||||
|
initializers:
|
||||||
|
- name: pvlabel.kubernetes.io
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
apiVersions:
|
||||||
|
- "*"
|
||||||
|
resources:
|
||||||
|
- persistentvolumes
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: busybox
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: busybox
|
||||||
|
image: busybox:1.28
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
- "3600"
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
restartPolicy: Always
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: dns-autoscaler
|
||||||
|
namespace: kube-system
|
||||||
|
labels:
|
||||||
|
k8s-app: dns-autoscaler
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: dns-autoscaler
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
k8s-app: dns-autoscaler
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: autoscaler
|
||||||
|
image: k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.1.1
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "20m"
|
||||||
|
memory: "10Mi"
|
||||||
|
command:
|
||||||
|
- /cluster-proportional-autoscaler
|
||||||
|
- --namespace=kube-system
|
||||||
|
- --configmap=dns-autoscaler
|
||||||
|
- --target=<SCALE_TARGET>
|
||||||
|
# When cluster is using large nodes(with more cores), "coresPerReplica" should dominate.
|
||||||
|
# If using small nodes, "nodesPerReplica" should dominate.
|
||||||
|
- --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"min":1}}
|
||||||
|
- --logtostderr=true
|
||||||
|
- --v=2
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: fluentd-config
|
||||||
|
data:
|
||||||
|
fluentd.conf: |
|
||||||
|
<source>
|
||||||
|
type tail
|
||||||
|
format none
|
||||||
|
path /var/log/1.log
|
||||||
|
pos_file /var/log/1.log.pos
|
||||||
|
tag count.format1
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<source>
|
||||||
|
type tail
|
||||||
|
format none
|
||||||
|
path /var/log/2.log
|
||||||
|
pos_file /var/log/2.log.pos
|
||||||
|
tag count.format2
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<match **>
|
||||||
|
type google_cloud
|
||||||
|
</match>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: counter
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: count
|
||||||
|
image: busybox
|
||||||
|
args:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
i=0;
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
echo "$i: $(date)" >> /var/log/1.log;
|
||||||
|
echo "$(date) INFO $i" >> /var/log/2.log;
|
||||||
|
i=$((i+1));
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: count-agent
|
||||||
|
image: k8s.gcr.io/fluentd-gcp:1.30
|
||||||
|
env:
|
||||||
|
- name: FLUENTD_ARGS
|
||||||
|
value: -c /etc/fluentd-config/fluentd.conf
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: config-volume
|
||||||
|
mountPath: /etc/fluentd-config
|
||||||
|
volumes:
|
||||||
|
- name: varlog
|
||||||
|
emptyDir: {}
|
||||||
|
- name: config-volume
|
||||||
|
configMap:
|
||||||
|
name: fluentd-config
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: counter
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: count
|
||||||
|
image: busybox
|
||||||
|
args:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
i=0;
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
echo "$i: $(date)" >> /var/log/1.log;
|
||||||
|
echo "$(date) INFO $i" >> /var/log/2.log;
|
||||||
|
i=$((i+1));
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: count-log-1
|
||||||
|
image: busybox
|
||||||
|
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/1.log']
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
- name: count-log-2
|
||||||
|
image: busybox
|
||||||
|
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/2.log']
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
volumes:
|
||||||
|
- name: varlog
|
||||||
|
emptyDir: {}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: counter
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: count
|
||||||
|
image: busybox
|
||||||
|
args:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
i=0;
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
echo "$i: $(date)" >> /var/log/1.log;
|
||||||
|
echo "$(date) INFO $i" >> /var/log/2.log;
|
||||||
|
i=$((i+1));
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
volumeMounts:
|
||||||
|
- name: varlog
|
||||||
|
mountPath: /var/log
|
||||||
|
volumes:
|
||||||
|
- name: varlog
|
||||||
|
emptyDir: {}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: my-scheduler
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: my-scheduler-as-kube-scheduler
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: my-scheduler
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kube-scheduler
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: scheduler
|
||||||
|
tier: control-plane
|
||||||
|
name: my-scheduler
|
||||||
|
namespace: kube-system
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
component: scheduler
|
||||||
|
tier: control-plane
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: scheduler
|
||||||
|
tier: control-plane
|
||||||
|
version: second
|
||||||
|
spec:
|
||||||
|
serviceAccountName: my-scheduler
|
||||||
|
containers:
|
||||||
|
- command:
|
||||||
|
- /usr/local/bin/kube-scheduler
|
||||||
|
- --address=0.0.0.0
|
||||||
|
- --leader-elect=false
|
||||||
|
- --scheduler-name=my-scheduler
|
||||||
|
image: gcr.io/my-gcp-project/my-kube-scheduler:1.0
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: 10251
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
name: kube-second-scheduler
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: 10251
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: '0.1'
|
||||||
|
securityContext:
|
||||||
|
privileged: false
|
||||||
|
volumeMounts: []
|
||||||
|
hostNetwork: false
|
||||||
|
hostPID: false
|
||||||
|
volumes: []
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: no-annotation
|
||||||
|
labels:
|
||||||
|
name: multischeduler-example
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: pod-with-no-annotation-container
|
||||||
|
image: k8s.gcr.io/pause:2.0
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: annotation-default-scheduler
|
||||||
|
labels:
|
||||||
|
name: multischeduler-example
|
||||||
|
spec:
|
||||||
|
schedulerName: default-scheduler
|
||||||
|
containers:
|
||||||
|
- name: pod-with-default-annotation-container
|
||||||
|
image: k8s.gcr.io/pause:2.0
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: annotation-second-scheduler
|
||||||
|
labels:
|
||||||
|
name: multischeduler-example
|
||||||
|
spec:
|
||||||
|
schedulerName: my-scheduler
|
||||||
|
containers:
|
||||||
|
- name: pod-with-second-annotation-container
|
||||||
|
image: k8s.gcr.io/pause:2.0
|
||||||
Reference in New Issue
Block a user