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

Take readiness probes into account #1

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

ytsarev
Copy link
Member

@ytsarev ytsarev commented Dec 2, 2019

Liveness probes might not be enough for GSLB scenario, we need
to be sure that the application is ready to accept the traffic after
some time after the start(java warm up is a classic example of that).

Thus, for reliable load balancing we should check for readiness
probe status and also strongly advise application team to configure one
for their workload(s)

Liveness probes might not be enough for GSLB scenario, we need
to be sure that the application is ready to accept the traffic after
some time after the start(java warm up is a classic example of that).

Thus, for reliable load balancing we should check for readiness
probe status and also strongly advise application team to configure one
for their workload(s)
@ytsarev
Copy link
Member Author

ytsarev commented Dec 2, 2019

@donovanmuller can't assign reviewers so pinging you here
@chriskieser could you please tweak access rights a bit ?

@donovanmuller donovanmuller merged commit 3531e41 into k8gb-io:master Dec 2, 2019
kuritka added a commit that referenced this pull request Nov 5, 2020
kuritka added a commit that referenced this pull request Nov 6, 2020
kuritka added a commit that referenced this pull request Nov 11, 2020
deploy-full-local-setup

fix localtargets name in documentation

local playground passed

wait

deploy-gslb-operator-14

k8gb terratest, moving to makefile

terratest-pipeline fix #1

terratest-pipeline fix #2

terratest-pipeline fix #3

terratest-pipeline fix #4

terratest-pipeline fix #5

move stable repo location from 	https://kubernetes-charts.storage.googleapis.com to https://charts.helm.sh/stable
see: https://helm.sh/blog/new-location-stable-incubator-charts/

highlight large script sections

fix version

fix version #2

fix version #3

fix version #4

simplify release pipeline, move logic to Makefile

fix terratest by adding image-repo between deploy-local-cluster args

registry.sh #1

registry.sh; installing docker registry always in deploy-full-terratest-setup; remove registry.sh

remove full.sh, remove registry.sh

test; functionality, hide generate, controller gent, manifest

remove GOPATH guardian as GO terraform-test runs clean ubuntu image, no GOLANG image

refactor generate and manifest

move kustomize

run

manager

install

infoblox-secret

retreive version from shell , deploy

fix deploy, remove  kustomize udf

bundle

build-bundle, debug-local

docker-test-build-push

change git-last-commit-hash into shell COMMIT_HASH

lowercase comments

alphabetically sort targets

remove deploy, bundle, bundle-build

remove debug-local and create debug-local-idea instead

refactor debug-local-idea to debug-idea

refactor debug-local-idea to debug-idea
kuritka added a commit that referenced this pull request Nov 11, 2020
deploy-full-local-setup

fix localtargets name in documentation

local playground passed

wait

deploy-gslb-operator-14

k8gb terratest, moving to makefile

terratest-pipeline fix #1

terratest-pipeline fix #2

terratest-pipeline fix #3

terratest-pipeline fix #4

terratest-pipeline fix #5

move stable repo location from 	https://kubernetes-charts.storage.googleapis.com to https://charts.helm.sh/stable
see: https://helm.sh/blog/new-location-stable-incubator-charts/

highlight large script sections

fix version

fix version #2

fix version #3

fix version #4

simplify release pipeline, move logic to Makefile

fix terratest by adding image-repo between deploy-local-cluster args

registry.sh #1

registry.sh; installing docker registry always in deploy-full-terratest-setup; remove registry.sh

remove full.sh, remove registry.sh

test; functionality, hide generate, controller gent, manifest

remove GOPATH guardian as GO terraform-test runs clean ubuntu image, no GOLANG image

refactor generate and manifest

move kustomize

run

manager

install

infoblox-secret

retreive version from shell , deploy

fix deploy, remove  kustomize udf

bundle

build-bundle, debug-local

docker-test-build-push

change git-last-commit-hash into shell COMMIT_HASH

lowercase comments

alphabetically sort targets

remove deploy, bundle, bundle-build

remove debug-local and create debug-local-idea instead

refactor debug-local-idea to debug-idea

refactor debug-local-idea to debug-idea
kuritka added a commit that referenced this pull request Nov 12, 2020
deploy-full-local-setup

fix localtargets name in documentation

local playground passed

wait

deploy-gslb-operator-14

k8gb terratest, moving to makefile

terratest-pipeline fix #1

terratest-pipeline fix #2

terratest-pipeline fix #3

terratest-pipeline fix #4

terratest-pipeline fix #5

move stable repo location from 	https://kubernetes-charts.storage.googleapis.com to https://charts.helm.sh/stable
see: https://helm.sh/blog/new-location-stable-incubator-charts/

highlight large script sections

fix version

fix version #2

fix version #3

fix version #4

simplify release pipeline, move logic to Makefile

fix terratest by adding image-repo between deploy-local-cluster args

registry.sh #1

registry.sh; installing docker registry always in deploy-full-terratest-setup; remove registry.sh

remove full.sh, remove registry.sh

test; functionality, hide generate, controller gent, manifest

remove GOPATH guardian as GO terraform-test runs clean ubuntu image, no GOLANG image

refactor generate and manifest

move kustomize

run

manager

install

infoblox-secret

retreive version from shell , deploy

fix deploy, remove  kustomize udf

bundle

build-bundle, debug-local

docker-test-build-push

change git-last-commit-hash into shell COMMIT_HASH

lowercase comments

alphabetically sort targets

remove deploy, bundle, bundle-build

remove debug-local and create debug-local-idea instead

refactor debug-local-idea to debug-idea

refactor debug-local-idea to debug-idea
kuritka added a commit that referenced this pull request Nov 12, 2020
deploy-full-local-setup

fix localtargets name in documentation

local playground passed

wait

deploy-gslb-operator-14

k8gb terratest, moving to makefile

terratest-pipeline fix #1

terratest-pipeline fix #2

terratest-pipeline fix #3

terratest-pipeline fix #4

terratest-pipeline fix #5

move stable repo location from 	https://kubernetes-charts.storage.googleapis.com to https://charts.helm.sh/stable
see: https://helm.sh/blog/new-location-stable-incubator-charts/

highlight large script sections

fix version

fix version #2

fix version #3

fix version #4

simplify release pipeline, move logic to Makefile

fix terratest by adding image-repo between deploy-local-cluster args

registry.sh #1

registry.sh; installing docker registry always in deploy-full-terratest-setup; remove registry.sh

remove full.sh, remove registry.sh

test; functionality, hide generate, controller gent, manifest

remove GOPATH guardian as GO terraform-test runs clean ubuntu image, no GOLANG image

refactor generate and manifest

move kustomize

run

manager

install

infoblox-secret

retreive version from shell , deploy

fix deploy, remove  kustomize udf

bundle

build-bundle, debug-local

docker-test-build-push

change git-last-commit-hash into shell COMMIT_HASH

lowercase comments

alphabetically sort targets

remove deploy, bundle, bundle-build

remove debug-local and create debug-local-idea instead

refactor debug-local-idea to debug-idea

refactor debug-local-idea to debug-idea
kuritka added a commit that referenced this pull request Nov 13, 2020
deploy-full-local-setup

fix localtargets name in documentation

local playground passed

wait

deploy-gslb-operator-14

k8gb terratest, moving to makefile

terratest-pipeline fix #1

terratest-pipeline fix #2

terratest-pipeline fix #3

terratest-pipeline fix #4

terratest-pipeline fix #5

move stable repo location from 	https://kubernetes-charts.storage.googleapis.com to https://charts.helm.sh/stable
see: https://helm.sh/blog/new-location-stable-incubator-charts/

highlight large script sections

fix version

fix version #2

fix version #3

fix version #4

simplify release pipeline, move logic to Makefile

fix terratest by adding image-repo between deploy-local-cluster args

registry.sh #1

registry.sh; installing docker registry always in deploy-full-terratest-setup; remove registry.sh

remove full.sh, remove registry.sh

test; functionality, hide generate, controller gent, manifest

remove GOPATH guardian as GO terraform-test runs clean ubuntu image, no GOLANG image

refactor generate and manifest

move kustomize

run

manager

install

infoblox-secret

retreive version from shell , deploy

fix deploy, remove  kustomize udf

bundle

build-bundle, debug-local

docker-test-build-push

change git-last-commit-hash into shell COMMIT_HASH

lowercase comments

alphabetically sort targets

remove deploy, bundle, bundle-build

remove debug-local and create debug-local-idea instead

refactor debug-local-idea to debug-idea

refactor debug-local-idea to debug-idea
kuritka added a commit that referenced this pull request Dec 2, 2020
kuritka added a commit that referenced this pull request Jan 15, 2021
kuritka added a commit that referenced this pull request Apr 7, 2021
kuritka added a commit that referenced this pull request Oct 26, 2021
related to #697

 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump)
 - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot)
 - `github.com/miekg/dns` to `v1.1.43`
 - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint)

The latest `sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible
with previous versions. This causes issues in `controller-runtime` and will require code changes on our side (another PR).
[This PR](kubernetes-sigs/controller-runtime#1593 (comment)) would be unblock
 - github.com/go-logr/logr
 - sigs.k8s.io/external-dns

Signed-off-by: kuritka <kuritka@gmail.com>
kuritka added a commit that referenced this pull request Oct 26, 2021
related to #697

 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump)
 - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot)
 - `github.com/miekg/dns` to `v1.1.43`
 - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint)

`sigs.k8s.io/controller-runtime` to `v0.10.2`

The latest `sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible
with previous versions. This causes issues in `controller-runtime` and will require code changes on our side (another PR).
[This PR](kubernetes-sigs/controller-runtime#1593 (comment)) would be unblock
 - github.com/go-logr/logr
 - sigs.k8s.io/external-dns

Signed-off-by: kuritka <kuritka@gmail.com>
kuritka added a commit that referenced this pull request Oct 26, 2021
related to #697

 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump)
 - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot)
 - `github.com/miekg/dns` to `v1.1.43`
 - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint)

`sigs.k8s.io/controller-runtime` to `v0.10.2` requires more effort,  will be part of follow-up PR

`sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible
with previous versions. Will be part of followup PR

Signed-off-by: kuritka <kuritka@gmail.com>
kuritka added a commit that referenced this pull request Oct 27, 2021
related to #697

 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump)
 - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot)
 - `github.com/miekg/dns` to `v1.1.43`
 - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint)
 - `sigs.k8s.io/controller-runtime` to `v0.10.2`, had to fix the test, see comment below.
 - `sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible
with previous versions. Will be part of followup PR

Controller-runtime works on copies of annotations rather than their pointers, so I had to modify the test.

```go
func TestGslbProperlyPropagatesAnnotationDownToIngress(t *testing.T) {
        // arrange
        settings := provideSettings(t, predefinedConfig)
        expectedAnnotations := map[string]string{"annotation": "test"}
        settings.gslb.Annotations = expectedAnnotations
        err := settings.client.Update(context.TODO(), settings.gslb)
        require.NoError(t, err, "Can't update gslb")
        // act
        reconcileAndUpdateGslb(t, settings)
        err2 := settings.client.Get(context.TODO(), settings.request.NamespacedName, settings.ingress)
        // assert
        assert.NoError(t, err2, "Failed to get expected ingress")
        assert.Equal(t, expectedAnnotations, settings.ingress.Annotations)
}
```

If I extend fial assertion the passing test is doing this:
```go
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, expectedAnnotations)
```

The `"k8gb.io/strategy": "roundRobin"` is added to `expectedAnnotations` during `reconcileAndUpdateGslb` and controlle-runtime
is the guy which extends `expectedAnnotations`.

I bumped controller runtime to `v0.10.2`, and only this concrete test has to be updated, because expectedAnnotations are not altered within controller-runtime:
```go
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations)
assert.Equal(t, map[string]string{"annotation": "test"}, expectedAnnotations)
```

Signed-off-by: kuritka <kuritka@gmail.com>
kuritka added a commit that referenced this pull request Oct 30, 2021
related to #697

 `k8s.io/*` bundle to `v0.22.2` (controller-gen tool makes changes in CRD description after bump)
 - `github.com/golang/mock` to `v1.6.0` (is not compiled into final binary but checked by dependabot)
 - `github.com/miekg/dns` to `v1.1.43`
 - `github.com/infobloxopen/infoblox-go-client` to `v1.1.1` (changes argument CreateTXTRecord from integer to uint)
 - `sigs.k8s.io/controller-runtime` to `v0.10.2`, had to fix the test, see comment below.
 - `sigs.k8s.io/external-dns` is problematic in terms it uses latest `github.com/go-logr/logr` which is incompatible
with previous versions. Will be part of followup PR

Controller-runtime works on copies of annotations rather than their pointers, so I had to modify the test.

```go
func TestGslbProperlyPropagatesAnnotationDownToIngress(t *testing.T) {
        // arrange
        settings := provideSettings(t, predefinedConfig)
        expectedAnnotations := map[string]string{"annotation": "test"}
        settings.gslb.Annotations = expectedAnnotations
        err := settings.client.Update(context.TODO(), settings.gslb)
        require.NoError(t, err, "Can't update gslb")
        // act
        reconcileAndUpdateGslb(t, settings)
        err2 := settings.client.Get(context.TODO(), settings.request.NamespacedName, settings.ingress)
        // assert
        assert.NoError(t, err2, "Failed to get expected ingress")
        assert.Equal(t, expectedAnnotations, settings.ingress.Annotations)
}
```

If I extend fial assertion the passing test is doing this:
```go
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, expectedAnnotations)
```

The `"k8gb.io/strategy": "roundRobin"` is added to `expectedAnnotations` during `reconcileAndUpdateGslb` and controlle-runtime
is the guy which extends `expectedAnnotations`.

I bumped controller runtime to `v0.10.2`, and only this concrete test has to be updated, because expectedAnnotations are not altered within controller-runtime:
```go
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.ingress.Annotations)
assert.Equal(t, map[string]string{"annotation": "test", "k8gb.io/strategy": "roundRobin"}, settings.gslb.Annotations)
assert.Equal(t, map[string]string{"annotation": "test"}, expectedAnnotations)
```

Signed-off-by: kuritka <kuritka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants