Update zh examples with updated test case
This commit is contained in:
@@ -1,32 +1,29 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: frontend
|
||||
labels:
|
||||
app.kubernetes.io/name: guestbook
|
||||
app.kubernetes.io/component: frontend
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: guestbook
|
||||
app.kubernetes.io/component: frontend
|
||||
replicas: 3
|
||||
app: guestbook
|
||||
tier: frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: guestbook
|
||||
app.kubernetes.io/component: frontend
|
||||
app: guestbook
|
||||
tier: frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: guestbook
|
||||
image: paulczar/gb-frontend:v5
|
||||
# image: gcr.io/google-samples/gb-frontend:v4
|
||||
- name: php-redis
|
||||
image: gcr.io/google_samples/gb-frontend:v5
|
||||
env:
|
||||
- name: GET_HOSTS_FROM
|
||||
value: "dns"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
env:
|
||||
- name: GET_HOSTS_FROM
|
||||
value: dns
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 80
|
||||
@@ -1,16 +1,19 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: frontend
|
||||
labels:
|
||||
app.kubernetes.io/name: guestbook
|
||||
app.kubernetes.io/component: frontend
|
||||
app: guestbook
|
||||
tier: frontend
|
||||
spec:
|
||||
# if your cluster supports it, uncomment the following to automatically create
|
||||
# an external load-balanced IP for the frontend service.
|
||||
# type: LoadBalancer
|
||||
#type: LoadBalancer
|
||||
ports:
|
||||
# the port that this service should serve on
|
||||
- port: 80
|
||||
selector:
|
||||
app.kubernetes.io/name: guestbook
|
||||
app.kubernetes.io/component: frontend
|
||||
app: guestbook
|
||||
tier: frontend
|
||||
@@ -1,31 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongo
|
||||
labels:
|
||||
app.kubernetes.io/name: mongo
|
||||
app.kubernetes.io/component: backend
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: mongo
|
||||
app.kubernetes.io/component: backend
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: mongo
|
||||
app.kubernetes.io/component: backend
|
||||
spec:
|
||||
containers:
|
||||
- name: mongo
|
||||
image: mongo:4.2
|
||||
args:
|
||||
- --bind_ip
|
||||
- 0.0.0.0
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
@@ -1,14 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo
|
||||
labels:
|
||||
app.kubernetes.io/name: mongo
|
||||
app.kubernetes.io/component: backend
|
||||
spec:
|
||||
ports:
|
||||
- port: 27017
|
||||
targetPort: 27017
|
||||
selector:
|
||||
app.kubernetes.io/name: mongo
|
||||
app.kubernetes.io/component: backend
|
||||
@@ -0,0 +1,30 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis-follower
|
||||
labels:
|
||||
app: redis
|
||||
role: follower
|
||||
tier: backend
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
role: follower
|
||||
tier: backend
|
||||
spec:
|
||||
containers:
|
||||
- name: follower
|
||||
image: gcr.io/google_samples/gb-redis-follower:v2
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
@@ -0,0 +1,17 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis-follower
|
||||
labels:
|
||||
app: redis
|
||||
role: follower
|
||||
tier: backend
|
||||
spec:
|
||||
ports:
|
||||
# the port that this service should serve on
|
||||
- port: 6379
|
||||
selector:
|
||||
app: redis
|
||||
role: follower
|
||||
tier: backend
|
||||
@@ -0,0 +1,30 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis-leader
|
||||
labels:
|
||||
app: redis
|
||||
role: leader
|
||||
tier: backend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
role: leader
|
||||
tier: backend
|
||||
spec:
|
||||
containers:
|
||||
- name: leader
|
||||
image: "docker.io/redis:6.0.5"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
@@ -0,0 +1,17 @@
|
||||
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis-leader
|
||||
labels:
|
||||
app: redis
|
||||
role: leader
|
||||
tier: backend
|
||||
spec:
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
selector:
|
||||
app: redis
|
||||
role: leader
|
||||
tier: backend
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: 'indexed-job'
|
||||
spec:
|
||||
completions: 5
|
||||
parallelism: 3
|
||||
completionMode: Indexed
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: 'worker'
|
||||
image: 'docker.io/library/busybox'
|
||||
command:
|
||||
- "rev"
|
||||
- "/input/data.txt"
|
||||
volumeMounts:
|
||||
- mountPath: /input
|
||||
name: input
|
||||
volumes:
|
||||
- name: input
|
||||
downwardAPI:
|
||||
items:
|
||||
- path: "data.txt"
|
||||
fieldRef:
|
||||
fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index']
|
||||
@@ -0,0 +1,35 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: 'indexed-job'
|
||||
spec:
|
||||
completions: 5
|
||||
parallelism: 3
|
||||
completionMode: Indexed
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
initContainers:
|
||||
- name: 'input'
|
||||
image: 'docker.io/library/bash'
|
||||
command:
|
||||
- "bash"
|
||||
- "-c"
|
||||
- |
|
||||
items=(foo bar baz qux xyz)
|
||||
echo ${items[$JOB_COMPLETION_INDEX]} > /input/data.txt
|
||||
volumeMounts:
|
||||
- mountPath: /input
|
||||
name: input
|
||||
containers:
|
||||
- name: 'worker'
|
||||
image: 'docker.io/library/busybox'
|
||||
command:
|
||||
- "rev"
|
||||
- "/input/data.txt"
|
||||
volumeMounts:
|
||||
- mountPath: /input
|
||||
name: input
|
||||
volumes:
|
||||
- name: input
|
||||
emptyDir: {}
|
||||
@@ -32,7 +32,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
// "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
|
||||
"k8s.io/kubernetes/pkg/apis/apps"
|
||||
@@ -70,7 +69,6 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/apis/networking/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/policy/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/settings/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/storage/install"
|
||||
)
|
||||
|
||||
@@ -100,7 +98,6 @@ func (g TestGroup) Codec() runtime.Codec {
|
||||
|
||||
func initGroups() {
|
||||
Groups = make(map[string]TestGroup)
|
||||
|
||||
groupNames := []string{
|
||||
api.GroupName,
|
||||
apps.GroupName,
|
||||
@@ -109,7 +106,6 @@ func initGroups() {
|
||||
networking.GroupName,
|
||||
policy.GroupName,
|
||||
rbac.GroupName,
|
||||
settings.GroupName,
|
||||
storage.GroupName,
|
||||
}
|
||||
|
||||
@@ -152,6 +148,19 @@ func getCodecForObject(obj runtime.Object) (runtime.Codec, error) {
|
||||
}
|
||||
|
||||
func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
podValidationOptions := validation.PodValidationOptions{
|
||||
AllowMultipleHugePageResources: true,
|
||||
AllowDownwardAPIHugePages: true,
|
||||
}
|
||||
|
||||
quotaValidationOptions := validation.ResourceQuotaValidationOptions{
|
||||
AllowPodAffinityNamespaceSelector: true,
|
||||
}
|
||||
|
||||
pspValidationOptions := policy_validation.PodSecurityPolicyValidationOptions{
|
||||
AllowEphemeralVolumeType: true,
|
||||
}
|
||||
|
||||
// Enable CustomPodDNS for testing
|
||||
// feature.DefaultFeatureGate.Set("CustomPodDNS=true")
|
||||
switch t := obj.(type) {
|
||||
@@ -186,7 +195,7 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
opts := validation.PodValidationOptions{
|
||||
AllowMultipleHugePageResources: true,
|
||||
}
|
||||
errors = validation.ValidatePod(t, opts)
|
||||
errors = validation.ValidatePodCreate(t, opts)
|
||||
case *api.PodList:
|
||||
for i := range t.Items {
|
||||
errors = append(errors, validateObject(&t.Items[i])...)
|
||||
@@ -195,12 +204,12 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = validation.ValidatePodTemplate(t)
|
||||
errors = validation.ValidatePodTemplate(t, podValidationOptions)
|
||||
case *api.ReplicationController:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = validation.ValidateReplicationController(t)
|
||||
errors = validation.ValidateReplicationController(t, podValidationOptions)
|
||||
case *api.ReplicationControllerList:
|
||||
for i := range t.Items {
|
||||
errors = append(errors, validateObject(&t.Items[i])...)
|
||||
@@ -209,7 +218,7 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = validation.ValidateResourceQuota(t)
|
||||
errors = validation.ValidateResourceQuota(t, quotaValidationOptions)
|
||||
case *api.Secret:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
@@ -219,7 +228,11 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = validation.ValidateService(t, true)
|
||||
// handle clusterIPs, logic copied from service strategy
|
||||
if len(t.Spec.ClusterIP) > 0 && len(t.Spec.ClusterIPs) == 0 {
|
||||
t.Spec.ClusterIPs = []string{t.Spec.ClusterIP}
|
||||
}
|
||||
errors = validation.ValidateService(t)
|
||||
case *api.ServiceAccount:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
@@ -233,7 +246,7 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = apps_validation.ValidateStatefulSet(t)
|
||||
errors = apps_validation.ValidateStatefulSet(t, podValidationOptions)
|
||||
case *autoscaling.HorizontalPodAutoscaler:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
@@ -254,12 +267,12 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = apps_validation.ValidateDaemonSet(t)
|
||||
errors = apps_validation.ValidateDaemonSet(t, podValidationOptions)
|
||||
case *apps.Deployment:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = apps_validation.ValidateDeployment(t)
|
||||
errors = apps_validation.ValidateDeployment(t, podValidationOptions)
|
||||
case *networking.Ingress:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
@@ -269,18 +282,30 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
Version: legacyscheme.Scheme.PrioritizedVersionsForGroup(networking.GroupName)[0].Version,
|
||||
}
|
||||
errors = networking_validation.ValidateIngressCreate(t, gv)
|
||||
case *networking.IngressClass:
|
||||
/*
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
gv := schema.GroupVersion{
|
||||
Group: networking.GroupName,
|
||||
Version: legacyscheme.Scheme.PrioritizedVersionsForGroup(networking.GroupName)[0].Version,
|
||||
}
|
||||
*/
|
||||
errors = networking_validation.ValidateIngressClass(t)
|
||||
|
||||
case *policy.PodSecurityPolicy:
|
||||
errors = policy_validation.ValidatePodSecurityPolicy(t)
|
||||
errors = policy_validation.ValidatePodSecurityPolicy(t, pspValidationOptions)
|
||||
case *apps.ReplicaSet:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = apps_validation.ValidateReplicaSet(t)
|
||||
errors = apps_validation.ValidateReplicaSet(t, podValidationOptions)
|
||||
case *batch.CronJob:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = batch_validation.ValidateCronJob(t)
|
||||
errors = batch_validation.ValidateCronJob(t, podValidationOptions)
|
||||
case *networking.NetworkPolicy:
|
||||
if t.Namespace == "" {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
@@ -291,6 +316,9 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||
t.Namespace = api.NamespaceDefault
|
||||
}
|
||||
errors = policy_validation.ValidatePodDisruptionBudget(t)
|
||||
case *rbac.ClusterRole:
|
||||
// clusterole does not accept namespace
|
||||
errors = rbac_validation.ValidateClusterRole(t)
|
||||
case *rbac.ClusterRoleBinding:
|
||||
// clusterolebinding does not accept namespace
|
||||
errors = rbac_validation.ValidateClusterRoleBinding(t)
|
||||
@@ -418,6 +446,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"storagelimits": {&api.LimitRange{}},
|
||||
},
|
||||
"admin/sched": {
|
||||
"clusterrole": {&rbac.ClusterRole{}},
|
||||
"my-scheduler": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &rbac.ClusterRoleBinding{}, &apps.Deployment{}},
|
||||
"pod1": {&api.Pod{}},
|
||||
"pod2": {&api.Pod{}},
|
||||
@@ -441,12 +470,12 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"cassandra-statefulset": {&apps.StatefulSet{}, &storage.StorageClass{}},
|
||||
},
|
||||
"application/guestbook": {
|
||||
"frontend-deployment": {&apps.Deployment{}},
|
||||
"frontend-service": {&api.Service{}},
|
||||
"redis-master-deployment": {&apps.Deployment{}},
|
||||
"redis-master-service": {&api.Service{}},
|
||||
"redis-slave-deployment": {&apps.Deployment{}},
|
||||
"redis-slave-service": {&api.Service{}},
|
||||
"frontend-deployment": {&apps.Deployment{}},
|
||||
"frontend-service": {&api.Service{}},
|
||||
"redis-follower-deployment": {&apps.Deployment{}},
|
||||
"redis-follower-service": {&api.Service{}},
|
||||
"redis-leader-deployment": {&apps.Deployment{}},
|
||||
"redis-leader-service": {&api.Service{}},
|
||||
},
|
||||
"application/hpa": {
|
||||
"php-apache": {&autoscaling.HorizontalPodAutoscaler{}},
|
||||
@@ -456,8 +485,10 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"nginx-svc": {&api.Service{}},
|
||||
},
|
||||
"application/job": {
|
||||
"cronjob": {&batch.CronJob{}},
|
||||
"job-tmpl": {&batch.Job{}},
|
||||
"cronjob": {&batch.CronJob{}},
|
||||
"job-tmpl": {&batch.Job{}},
|
||||
"indexed-job": {&batch.Job{}},
|
||||
"indexed-job-vol": {&batch.Job{}},
|
||||
},
|
||||
"application/job/rabbitmq": {
|
||||
"job": {&batch.Job{}},
|
||||
@@ -536,13 +567,15 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"two-container-pod": {&api.Pod{}},
|
||||
},
|
||||
"pods/config": {
|
||||
"redis-pod": {&api.Pod{}},
|
||||
"redis-pod": {&api.Pod{}},
|
||||
"example-redis-config": {&api.ConfigMap{}},
|
||||
},
|
||||
"pods/inject": {
|
||||
"dapi-envars-container": {&api.Pod{}},
|
||||
"dapi-envars-pod": {&api.Pod{}},
|
||||
"dapi-volume": {&api.Pod{}},
|
||||
"dapi-volume-resources": {&api.Pod{}},
|
||||
"dependent-envars": {&api.Pod{}},
|
||||
"envars": {&api.Pod{}},
|
||||
"pod-multiple-secret-env-variable": {&api.Pod{}},
|
||||
"pod-secret-envFrom": {&api.Pod{}},
|
||||
@@ -588,10 +621,11 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"redis": {&api.Pod{}},
|
||||
},
|
||||
"policy": {
|
||||
"baseline-psp": {&policy.PodSecurityPolicy{}},
|
||||
"example-psp": {&policy.PodSecurityPolicy{}},
|
||||
"privileged-psp": {&policy.PodSecurityPolicy{}},
|
||||
"restricted-psp": {&policy.PodSecurityPolicy{}},
|
||||
"baseline-psp": {&policy.PodSecurityPolicy{}},
|
||||
"example-psp": {&policy.PodSecurityPolicy{}},
|
||||
"priority-class-resourcequota": {&api.ResourceQuota{}},
|
||||
"privileged-psp": {&policy.PodSecurityPolicy{}},
|
||||
"restricted-psp": {&policy.PodSecurityPolicy{}},
|
||||
"zookeeper-pod-disruption-budget-maxunavailable": {&policy.PodDisruptionBudget{}},
|
||||
"zookeeper-pod-disruption-budget-minavailable": {&policy.PodDisruptionBudget{}},
|
||||
},
|
||||
@@ -600,29 +634,42 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"load-balancer-example": {&apps.Deployment{}},
|
||||
},
|
||||
"service/access": {
|
||||
"frontend": {&api.Service{}, &apps.Deployment{}},
|
||||
"hello-application": {&apps.Deployment{}},
|
||||
"hello-service": {&api.Service{}},
|
||||
"hello": {&apps.Deployment{}},
|
||||
"backend-deployment": {&apps.Deployment{}},
|
||||
"backend-service": {&api.Service{}},
|
||||
"frontend-deployment": {&apps.Deployment{}},
|
||||
"frontend-service": {&api.Service{}},
|
||||
"hello-application": {&apps.Deployment{}},
|
||||
},
|
||||
"service/networking": {
|
||||
"curlpod": {&apps.Deployment{}},
|
||||
"custom-dns": {&api.Pod{}},
|
||||
"dual-stack-default-svc": {&api.Service{}},
|
||||
"dual-stack-ipv4-svc": {&api.Service{}},
|
||||
"dual-stack-ipv6-lb-svc": {&api.Service{}},
|
||||
"dual-stack-ipv6-svc": {&api.Service{}},
|
||||
"hostaliases-pod": {&api.Pod{}},
|
||||
"ingress": {&networking.Ingress{}},
|
||||
"network-policy-allow-all-egress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-allow-all-ingress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-egress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-ingress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-all": {&networking.NetworkPolicy{}},
|
||||
"nginx-policy": {&networking.NetworkPolicy{}},
|
||||
"nginx-secure-app": {&api.Service{}, &apps.Deployment{}},
|
||||
"nginx-svc": {&api.Service{}},
|
||||
"run-my-nginx": {&apps.Deployment{}},
|
||||
"curlpod": {&apps.Deployment{}},
|
||||
"custom-dns": {&api.Pod{}},
|
||||
"dual-stack-default-svc": {&api.Service{}},
|
||||
"dual-stack-ipfamilies-ipv6": {&api.Service{}},
|
||||
"dual-stack-ipv6-svc": {&api.Service{}},
|
||||
"dual-stack-prefer-ipv6-lb-svc": {&api.Service{}},
|
||||
"dual-stack-preferred-ipfamilies-svc": {&api.Service{}},
|
||||
"dual-stack-preferred-svc": {&api.Service{}},
|
||||
"external-lb": {&networking.IngressClass{}},
|
||||
"example-ingress": {&networking.Ingress{}},
|
||||
"hostaliases-pod": {&api.Pod{}},
|
||||
"ingress-resource-backend": {&networking.Ingress{}},
|
||||
"ingress-wildcard-host": {&networking.Ingress{}},
|
||||
"minimal-ingress": {&networking.Ingress{}},
|
||||
"name-virtual-host-ingress": {&networking.Ingress{}},
|
||||
"name-virtual-host-ingress-no-third-host": {&networking.Ingress{}},
|
||||
"namespaced-params": {&networking.IngressClass{}},
|
||||
"network-policy-allow-all-egress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-allow-all-ingress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-egress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-ingress": {&networking.NetworkPolicy{}},
|
||||
"network-policy-default-deny-all": {&networking.NetworkPolicy{}},
|
||||
"nginx-policy": {&networking.NetworkPolicy{}},
|
||||
"nginx-secure-app": {&api.Service{}, &apps.Deployment{}},
|
||||
"nginx-svc": {&api.Service{}},
|
||||
"run-my-nginx": {&apps.Deployment{}},
|
||||
"simple-fanout-example": {&networking.Ingress{}},
|
||||
"test-ingress": {&networking.Ingress{}},
|
||||
"tls-example-ingress": {&networking.Ingress{}},
|
||||
},
|
||||
"windows": {
|
||||
"configmap-pod": {&api.ConfigMap{}, &api.Pod{}},
|
||||
|
||||
+4
-2
@@ -2,11 +2,13 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: my-service
|
||||
labels:
|
||||
app: MyApp
|
||||
spec:
|
||||
ipFamily: IPv4
|
||||
ipFamilies:
|
||||
- IPv6
|
||||
selector:
|
||||
app: MyApp
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 9376
|
||||
+3
-2
@@ -5,11 +5,12 @@ metadata:
|
||||
labels:
|
||||
app: MyApp
|
||||
spec:
|
||||
ipFamily: IPv6
|
||||
ipFamilyPolicy: PreferDualStack
|
||||
ipFamilies:
|
||||
- IPv6
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: MyApp
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 9376
|
||||
Reference in New Issue
Block a user