sync zh/ en/ (#19918)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"kind": "Namespace",
|
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
|
"kind": "Namespace",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "development",
|
"name": "development",
|
||||||
"labels": {
|
"labels": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"kind": "Namespace",
|
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
|
"kind": "Namespace",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "production",
|
"name": "production",
|
||||||
"labels": {
|
"labels": {
|
||||||
|
|||||||
@@ -13,4 +13,3 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
memory: "700Mi"
|
memory: "700Mi"
|
||||||
cpu: "400m"
|
cpu: "400m"
|
||||||
|
|
||||||
|
|||||||
@@ -13,4 +13,3 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
memory: "600Mi"
|
memory: "600Mi"
|
||||||
cpu: "400m"
|
cpu: "400m"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: snowflake
|
||||||
|
name: snowflake
|
||||||
|
spec:
|
||||||
|
replicas: 2
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: snowflake
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: snowflake
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: k8s.gcr.io/serve_hostname
|
||||||
|
imagePullPolicy: Always
|
||||||
|
name: snowflake
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Specify BROKER_URL and QUEUE when running
|
# Specify BROKER_URL and QUEUE when running
|
||||||
FROM ubuntu:14.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl ca-certificates amqp-tools python \
|
apt-get install -y curl ca-certificates amqp-tools python \
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
# Just prints standard out and sleeps for 10 seconds.
|
# Just prints standard out and sleeps for 10 seconds.
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
print("Processing " + sys.stdin.lines())
|
print("Processing " + sys.stdin.readlines()[0])
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class RedisWQ(object):
|
|||||||
# If we crash here, then the GC code will try to move the value, but it will
|
# If we crash here, then the GC code will try to move the value, but it will
|
||||||
# not be here, which is fine. So this does not need to be a transaction.
|
# not be here, which is fine. So this does not need to be a transaction.
|
||||||
itemkey = self._itemkey(value)
|
itemkey = self._itemkey(value)
|
||||||
self._db.delete(self._lease_key_prefix + itemkey, self._session)
|
self._db.delete(self._lease_key_prefix + itemkey)
|
||||||
|
|
||||||
# TODO: add functions to clean up all keys associated with "name" when
|
# TODO: add functions to clean up all keys associated with "name" when
|
||||||
# processing is complete.
|
# processing is complete.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ print("Initial queue state: empty=" + str(q.empty()))
|
|||||||
while not q.empty():
|
while not q.empty():
|
||||||
item = q.lease(lease_secs=10, block=True, timeout=2)
|
item = q.lease(lease_secs=10, block=True, timeout=2)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
itemstr = item.decode("utf=8")
|
itemstr = item.decode("utf-8")
|
||||||
print("Working on " + itemstr)
|
print("Working on " + itemstr)
|
||||||
time.sleep(10) # Put your actual work here instead of sleep.
|
time.sleep(10) # Put your actual work here instead of sleep.
|
||||||
q.complete(item)
|
q.complete(item)
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: php-apache
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
run: php-apache
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
run: php-apache
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: php-apache
|
||||||
|
image: k8s.gcr.io/hpa-example
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: php-apache
|
||||||
|
labels:
|
||||||
|
run: php-apache
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
selector:
|
||||||
|
run: php-apache
|
||||||
|
|
||||||
@@ -34,8 +34,6 @@ import (
|
|||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
|
||||||
ar_validation "k8s.io/kubernetes/pkg/apis/admissionregistration/validation"
|
|
||||||
"k8s.io/kubernetes/pkg/apis/apps"
|
"k8s.io/kubernetes/pkg/apis/apps"
|
||||||
apps_validation "k8s.io/kubernetes/pkg/apis/apps/validation"
|
apps_validation "k8s.io/kubernetes/pkg/apis/apps/validation"
|
||||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||||
@@ -434,12 +432,6 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"node-problem-detector-configmap": {&apps.DaemonSet{}},
|
"node-problem-detector-configmap": {&apps.DaemonSet{}},
|
||||||
"termination": {&api.Pod{}},
|
"termination": {&api.Pod{}},
|
||||||
},
|
},
|
||||||
"federation": {
|
|
||||||
"policy-engine-deployment": {&apps.Deployment{}},
|
|
||||||
"policy-engine-service": {&api.Service{}},
|
|
||||||
"replicaset-example-policy": {&apps.ReplicaSet{}},
|
|
||||||
"scheduling-policy-admission": {&api.ConfigMap{}},
|
|
||||||
},
|
|
||||||
"podpreset": {
|
"podpreset": {
|
||||||
"allow-db": {&settings.PodPreset{}},
|
"allow-db": {&settings.PodPreset{}},
|
||||||
"allow-db-merged": {&api.Pod{}},
|
"allow-db-merged": {&api.Pod{}},
|
||||||
@@ -525,9 +517,9 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"redis": {&api.Pod{}},
|
"redis": {&api.Pod{}},
|
||||||
},
|
},
|
||||||
"policy": {
|
"policy": {
|
||||||
"privileged-psp": {&policy.PodSecurityPolicy{}},
|
"privileged-psp": {&policy.PodSecurityPolicy{}},
|
||||||
"restricted-psp": {&policy.PodSecurityPolicy{}},
|
"restricted-psp": {&policy.PodSecurityPolicy{}},
|
||||||
"example-psp": {&policy.PodSecurityPolicy{}},
|
"example-psp": {&policy.PodSecurityPolicy{}},
|
||||||
"zookeeper-pod-disruption-budget-maxunavailable": {&policy.PodDisruptionBudget{}},
|
"zookeeper-pod-disruption-budget-maxunavailable": {&policy.PodDisruptionBudget{}},
|
||||||
"zookeeper-pod-disruption-budget-minunavailable": {&policy.PodDisruptionBudget{}},
|
"zookeeper-pod-disruption-budget-minunavailable": {&policy.PodDisruptionBudget{}},
|
||||||
},
|
},
|
||||||
@@ -569,8 +561,6 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
capabilities.SetForTests(capabilities.Capabilities{
|
capabilities.SetForTests(capabilities.Capabilities{
|
||||||
AllowPrivileged: true,
|
AllowPrivileged: true,
|
||||||
})
|
})
|
||||||
// PodShareProcessNamespace needed for example share-process-namespace.yaml
|
|
||||||
utilfeature.DefaultFeatureGate.Set("PodShareProcessNamespace=true")
|
|
||||||
|
|
||||||
for dir, expected := range cases {
|
for dir, expected := range cases {
|
||||||
tested := 0
|
tested := 0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:6.14.2
|
FROM node:6.14.2
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
COPY server.js .
|
COPY server.js .
|
||||||
CMD node server.js
|
CMD [ "node", "server.js" ]
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
labels:
|
||||||
|
env: test
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
tolerations:
|
||||||
|
- key: "example-key"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-all-egress
|
||||||
|
spec:
|
||||||
|
podSelector: {}
|
||||||
|
egress:
|
||||||
|
- {}
|
||||||
|
policyTypes:
|
||||||
|
- Egress
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: allow-all-ingress
|
||||||
|
spec:
|
||||||
|
podSelector: {}
|
||||||
|
ingress:
|
||||||
|
- {}
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: default-deny-all
|
||||||
|
spec:
|
||||||
|
podSelector: {}
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
- Egress
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: default-deny-egress
|
||||||
|
spec:
|
||||||
|
podSelector: {}
|
||||||
|
policyTypes:
|
||||||
|
- Egress
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: default-deny-ingress
|
||||||
|
spec:
|
||||||
|
podSelector: {}
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: access-nginx
|
||||||
|
spec:
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
ingress:
|
||||||
|
- from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
access: "true"
|
||||||
Reference in New Issue
Block a user