mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Add readinessProbe to aggregated api service test
This commit is contained in:
parent
fa16bf8e12
commit
34f5938abe
@ -145,7 +145,7 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
|
||||
},
|
||||
}
|
||||
_, err := client.CoreV1().Secrets(namespace).Create(context.TODO(), secret, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, "creating secret %q in namespace %q", secretName, namespace)
|
||||
framework.ExpectNoError(err, "creating secret %s in namespace %s", secretName, namespace)
|
||||
|
||||
// kubectl create -f clusterrole.yaml
|
||||
_, err = client.RbacV1().ClusterRoles().Create(context.TODO(), &rbacv1.ClusterRole{
|
||||
@ -238,6 +238,19 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
|
||||
"--audit-log-maxbackup=0",
|
||||
},
|
||||
Image: image,
|
||||
ReadinessProbe: &v1.Probe{
|
||||
ProbeHandler: v1.ProbeHandler{
|
||||
HTTPGet: &v1.HTTPGetAction{
|
||||
Scheme: v1.URISchemeHTTPS,
|
||||
Port: intstr.FromInt(443),
|
||||
Path: "/readyz",
|
||||
},
|
||||
},
|
||||
InitialDelaySeconds: 20,
|
||||
PeriodSeconds: 1,
|
||||
SuccessThreshold: 1,
|
||||
FailureThreshold: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "etcd",
|
||||
@ -284,7 +297,7 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
|
||||
},
|
||||
}
|
||||
_, err = client.CoreV1().Services(namespace).Create(context.TODO(), service, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, "creating service %s in namespace %s", "sample-apiserver", namespace)
|
||||
framework.ExpectNoError(err, "creating service %s in namespace %s", "sample-api", namespace)
|
||||
|
||||
// kubectl create -f serviceAccount.yaml
|
||||
sa := &v1.ServiceAccount{ObjectMeta: metav1.ObjectMeta{Name: "sample-apiserver"}}
|
||||
@ -312,7 +325,7 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
|
||||
},
|
||||
},
|
||||
}, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, "creating role binding %s:sample-apiserver to access configMap", namespace)
|
||||
framework.ExpectNoError(err, "creating role binding %s in namespace %s", "wardler-auth-reader", "kube-system")
|
||||
|
||||
// Wait for the extension apiserver to be up and healthy
|
||||
// kubectl get deployments -n <aggregated-api-namespace> && status == Running
|
||||
@ -337,7 +350,7 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
|
||||
VersionPriority: 200,
|
||||
},
|
||||
}, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, "creating apiservice %s with namespace %s", "v1alpha1.wardle.example.com", namespace)
|
||||
framework.ExpectNoError(err, "creating apiservice %s", "v1alpha1.wardle.example.com")
|
||||
|
||||
var (
|
||||
currentAPIService *apiregistrationv1.APIService
|
||||
|
Loading…
Reference in New Issue
Block a user