Skip to content

Commit 39c9630

Browse files
author
Steve Azzopardi
committed
Merge branch '10341-enable-k8s-attach-by-default' into 'master'
Enable kubernetes attach strategy by default Closes #10341 See merge request gitlab-org/gitlab-runner!2955
2 parents 47699b6 + 161f6f5 commit 39c9630

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

docs/configuration/feature-flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The flags are defined in `./helpers/featureflags/flags.go` file.
4141
|--------------|---------------|------------|--------------------|-------------|
4242
| `FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION` | `false` || | Disables [EnableDelayedExpansion](https://ss64.com/nt/delayedexpansion.html) for error checking for when using [Window Batch](../shells/index.md#windows-batch) shell |
4343
| `FF_NETWORK_PER_BUILD` | `false` || | Enables creation of a Docker [network per build](../executors/docker.md#networking) with the `docker` executor |
44-
| `FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY` | `true` || | When set to `false` disables execution of remote Kubernetes commands through `exec` in favor of `attach` to solve problems like [#4119](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4119) |
44+
| `FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY` | `false` || | When set to `false` disables execution of remote Kubernetes commands through `exec` in favor of `attach` to solve problems like [#4119](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4119) |
4545
| `FF_USE_DIRECT_DOWNLOAD` | `true` || | When set to `true` Runner tries to direct-download all artifacts instead of proxying through GitLab on a first try. Enabling might result in a download failures due to problem validating TLS certificate of Object Storage if it is enabled by GitLab. See [Self-signed certificates or custom Certification Authorities](tls-self-signed.md) |
4646
| `FF_SKIP_NOOP_BUILD_STAGES` | `true` || | When set to `false` all build stages are executed even if running them has no effect |
4747
| `FF_USE_FASTZIP` | `false` || | Fastzip is a performant archiver for cache/artifact archiving and extraction |

docs/executors/kubernetes.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,17 @@ For more information, see [Building images with kaniko and GitLab CI/CD](https:/
876876

877877
## Job execution
878878

879-
At the moment we are using `kube exec` to run the scripts, which relies on
880-
having a stable network connection between the Runner and the pod for the duration of the command.
881-
This leads to problems like [Job marked as success midway](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4119).
882-
If you are experiencing this problem turn off the feature flag [`FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY`](../configuration/feature-flags.md#available-feature-flags)
883-
to use `kube attach` for script execution, which is more stable.
879+
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1775) in GitLab Runner 12.9.
880+
> - [Behind a feature flag `FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY`](../configuration/feature-flags.md#available-feature-flags), enabled by default.
881+
> - [Using attach by default](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/10341) in GitLab Runner 14.0.
884882

885-
We are rolling this out slowly and have plans to enable the `kube attach` behavior by default in future release, please follow [#10341](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/10341) for updates.
883+
GitLab Runner uses `kube attach` instead of `kube exec` by default. This should avoid problems such as [Job marked as success midway](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4119)
884+
in environments with unstable network.
885+
886+
If you are experiencing problems since updating to GitLab Runner 14.0, toggle the feature flag [`FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY`](../configuration/feature-flags.md#available-feature-flags)
887+
to `true` and [submit an issue](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/new).
888+
889+
Follow [#27976](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27976) for progress regarding legacy execution strategy removal.
886890

887891
## Troubleshooting
888892

helpers/featureflags/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var flags = []FeatureFlag{
5454
},
5555
{
5656
Name: UseLegacyKubernetesExecutionStrategy,
57-
DefaultValue: true,
57+
DefaultValue: false,
5858
Deprecated: false,
5959
ToBeRemovedWith: "",
6060
Description: "When set to `false` disables execution of remote Kubernetes commands through `exec` in " +

0 commit comments

Comments
 (0)