Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allocator readiness configurations doc #3142

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,9 @@ make test-e2e-integration ARGS='-run TestGameServerReserve'
#### `make test-e2e-failure`
Run controller failure portion of the end-to-end tests.

#### `make test-e2e-allocator-crash`
Run allocator failure portion of the end-to-end test.

#### `make setup-prometheus`

Install Prometheus server using [Prometheus Community](https://prometheus-community.github.io/helm-charts)
Expand Down
3 changes: 3 additions & 0 deletions site/content/en/docs/Installation/Install Agones/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ The following tables lists the configurable parameters of the Agones chart and t
| Parameter | Description | Default |
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `agones.allocator.labels` | [Labels][labels] Added to the Agones Allocator pods | `{}` |
| `agones.allocator.readiness.initialDelaySeconds` | Initial delay before performing the first probe (in seconds) | `3` |
| `agones.allocator.readiness.periodSeconds` | Seconds between every liveness probe (in seconds) | `3` |
| `agones.allocator.readiness.failureThreshold` | Number of times before giving up (in seconds) | `3` |

{{% /feature %}}

Expand Down
17 changes: 14 additions & 3 deletions test/e2e/allocator/pod_termination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/wait"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
Expand All @@ -40,13 +42,22 @@ func TestAllocatorAfterDeleteReplica(t *testing.T) {

var list *v1.PodList

dep, err := framework.KubeClient.AppsV1().Deployments("agones-system").Get(ctx, "agones-allocator", metav1.GetOptions{})
require.NoError(t, err, "Failed to get replicas")
replicaCnt := int(*(dep.Spec.Replicas))
logrus.Infof("Replica count config is %d", replicaCnt)

// poll and wait until all allocator pods are running
_ = wait.PollImmediate(retryInterval, retryTimeout, func() (done bool, err error) {
list, err = helper.GetAgonesAllocatorPods(ctx, framework)
if err != nil {
return true, err
}

if len(list.Items) != replicaCnt {
return false, nil
}

for _, allocpod := range list.Items {
podstatus := string(allocpod.Status.Phase)
logrus.Infof("Allocator Pod %s, has status of %s", allocpod.ObjectMeta.Name, podstatus)
Expand All @@ -58,9 +69,6 @@ func TestAllocatorAfterDeleteReplica(t *testing.T) {
return true, nil
})

grpcClient, err := helper.GetAllocatorClient(ctx, t, framework)
require.NoError(t, err, "Could not initialize rpc client")

// create fleet
flt, err := helper.CreateFleet(ctx, framework.Namespace, framework)
if !assert.Nil(t, err) {
Expand All @@ -82,6 +90,9 @@ func TestAllocatorAfterDeleteReplica(t *testing.T) {
require.NoError(t, err, "Could not delete allocator pod")
}

grpcClient, err := helper.GetAllocatorClient(ctx, t, framework)
require.NoError(t, err, "Could not initialize rpc client")

// Wait and keep making calls till we know the draining time has passed
_ = wait.PollImmediate(retryInterval, retryTimeout, func() (bool, error) {
response, err = grpcClient.Allocate(context.Background(), request)
Expand Down