Skip to content

Commit

Permalink
chore: removed deprecated kubelet executor. Fixes #7803 (#8215)
Browse files Browse the repository at this point in the history
* chore: remove deprecated kubelet executor. Fixes #7803

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* chore: removed kubelet refs

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* chore: remove BaseLayerArtifact refs

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* fix: restore manifests

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* fix: cleanup

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* fix: removed unused vars

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* docs: updated workflow-controller-configmap.yaml

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>

* docs: updated workflow-executors.md

Signed-off-by: Rohan Kumar <rohankmr414@gmail.com>
  • Loading branch information
rohankmr414 authored Mar 27, 2022
1 parent 800a247 commit 8dbd45c
Show file tree
Hide file tree
Showing 20 changed files with 5 additions and 533 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ jobs:
- test: test-executor
containerRuntimeExecutor: emissary
profile: minimal
- test: test-executor
containerRuntimeExecutor: kubelet
profile: minimal
- test: test-executor
containerRuntimeExecutor: pns
profile: minimal
Expand Down
3 changes: 0 additions & 3 deletions cmd/argoexec/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/argoproj/argo-workflows/v3/workflow/common"
"github.com/argoproj/argo-workflows/v3/workflow/executor"
"github.com/argoproj/argo-workflows/v3/workflow/executor/emissary"
"github.com/argoproj/argo-workflows/v3/workflow/executor/kubelet"
"github.com/argoproj/argo-workflows/v3/workflow/executor/pns"
)

Expand Down Expand Up @@ -112,8 +111,6 @@ func initExecutor() *executor.WorkflowExecutor {
var cre executor.ContainerRuntimeExecutor
log.Infof("Creating a %s executor", executorType)
switch executorType {
case common.ContainerRuntimeExecutorKubelet:
cre, err = kubelet.NewKubeletExecutor(namespace, podName)
case common.ContainerRuntimeExecutorPNS:
cre, err = pns.NewPNSExecutor(clientset, podName, namespace)
default:
Expand Down
6 changes: 0 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ type Config struct {

ContainerRuntimeExecutors ContainerRuntimeExecutors `json:"containerRuntimeExecutors,omitempty"`

// KubeletPort is needed when using the kubelet containerRuntimeExecutor, default to 10250
KubeletPort int `json:"kubeletPort,omitempty"`

// KubeletInsecure disable the TLS verification of the kubelet containerRuntimeExecutor, default to false
KubeletInsecure bool `json:"kubeletInsecure,omitempty"`

// ArtifactRepository contains the default location of an artifact repository for container artifacts
ArtifactRepository wfv1.ArtifactRepository `json:"artifactRepository,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ data:
# (available v2.4-v3.3)
dockerSockPath: /var/someplace/else/docker.sock

# kubelet port when using kubelet executor (default: 10250)
# kubelet port when using kubelet executor (default: 10250) (kubelet executor will be deprecated use emissary instead)
kubeletPort: 10250

# disable the TLS verification of the kubelet executor (default: false)
Expand Down
2 changes: 2 additions & 0 deletions docs/workflow-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ The emissary will exit with code 64 if it fails. This may indicate a bug in the

## Kubelet (kubelet)

⚠️Deprecated.

* Secure
* No `privileged` access
* Cannot escape the privileges of the pod's service account
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/argo_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ func (s *ArgoServerSuite) TestWorkflowService() {
})

s.Run("Terminate", func() {
s.Need(fixtures.None(fixtures.Kubelet))
s.e().PUT("/api/v1/workflows/argo/" + name + "/terminate").
Expect().
Status(200)
Expand All @@ -873,7 +872,6 @@ func (s *ArgoServerSuite) TestWorkflowService() {
})

s.Run("Resubmit", func() {
s.Need(fixtures.BaseLayerArtifacts)
s.e().PUT("/api/v1/workflows/argo/" + name + "/resubmit").
WithBytes([]byte(`{"memoized": true}`)).
Expect().
Expand Down Expand Up @@ -1347,7 +1345,6 @@ spec:
})

s.Run("Resubmit", func() {
s.Need(fixtures.BaseLayerArtifacts)
s.e().PUT("/api/v1/archived-workflows/{uid}/resubmit", uid).
WithBytes([]byte(`{"namespace": "argo", "memoized": false}`)).
Expect().
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func (s *ArtifactsSuite) TestOutputOnMount() {
}

func (s *ArtifactsSuite) TestOutputOnInput() {
s.Need(fixtures.BaseLayerArtifacts) // I believe this would work on both K8S and Kubelet, but validation does not allow it
s.Given().
Workflow("@testdata/output-on-input-workflow.yaml").
When().
Expand All @@ -45,7 +44,6 @@ func (s *ArtifactsSuite) TestOutputOnInput() {
}

func (s *ArtifactsSuite) TestArtifactPassing() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow("@smoke/artifact-passing.yaml").
When().
Expand All @@ -54,7 +52,6 @@ func (s *ArtifactsSuite) TestArtifactPassing() {
}

func (s *ArtifactsSuite) TestDefaultParameterOutputs() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow(`
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -107,7 +104,6 @@ spec:
}

func (s *ArtifactsSuite) TestSameInputOutputPathOptionalArtifact() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow("@testdata/same-input-output-path-optional.yaml").
When().
Expand Down Expand Up @@ -146,7 +142,6 @@ func (s *ArtifactsSuite) TestMainLog() {
}
})
})
s.Need(fixtures.None(fixtures.Kubelet))
s.Run("ActiveDeadlineSeconds", func() {
s.Given().
Workflow("@expectedfailures/timeouts-step.yaml").
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/fixtures/needs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ var (
CI Need = func(s *E2ESuite) (bool, string) {
return os.Getenv("CI") != "", "CI"
}
BaseLayerArtifacts Need = func(s *E2ESuite) (bool, string) {
met, _ := None(Kubelet)(s)
return met, "base layer artifact support"
}
Emissary = Executor("emissary")
Kubelet = Executor("kubelet")
PNS = Executor("pns")
)

Expand Down
4 changes: 0 additions & 4 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type FunctionalSuite struct {
}

func (s *FunctionalSuite) TestArchiveStrategies() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow(`@testdata/archive-strategies.yaml`).
When().
Expand Down Expand Up @@ -388,7 +387,6 @@ func (s *FunctionalSuite) TestEventOnPVCFail() {
}

func (s *FunctionalSuite) TestArtifactRepositoryRef() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow("@testdata/artifact-repository-ref.yaml").
When().
Expand Down Expand Up @@ -536,7 +534,6 @@ spec:
}

func (s *FunctionalSuite) TestParameterAggregation() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow("@functional/param-aggregation.yaml").
When().
Expand Down Expand Up @@ -860,7 +857,6 @@ spec:
}

func (s *FunctionalSuite) TestOutputArtifactS3BucketCreationEnabled() {
s.Need(fixtures.BaseLayerArtifacts)
s.Given().
Workflow("@testdata/output-artifact-with-s3-bucket-creation-enabled.yaml").
When().
Expand Down
1 change: 0 additions & 1 deletion test/e2e/run_as_not_root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func (s *RunAsNonRootSuite) TestRunAsNonRootWorkflow() {
}

func (s *RunAsNonRootSuite) TestRunAsNonRootWithOutputParams() {
s.Need(fixtures.None(fixtures.Kubelet))
s.Given().
Workflow("@smoke/runasnonroot-output-params-pipeline.yaml").
When().
Expand Down
6 changes: 0 additions & 6 deletions test/e2e/signals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ type SignalsSuite struct {
fixtures.E2ESuite
}

func (s *SignalsSuite) SetupSuite() {
s.E2ESuite.SetupSuite()
// Because k8ssapi and kubelet execute `sh -c 'kill 15 1'` to they do not work.
s.Need(fixtures.None(fixtures.Kubelet))
}

func (s *SignalsSuite) TestStopBehavior() {
s.Given().
Workflow("@functional/stop-terminate.yaml").
Expand Down
3 changes: 0 additions & 3 deletions workflow/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ const (
// EnvAgentPatchRate is the rate that the Argo Agent will patch the Workflow TaskSet
EnvAgentPatchRate = "ARGO_AGENT_PATCH_RATE"

// ContainerRuntimeExecutorKubelet to use the kubelet as container runtime executor
ContainerRuntimeExecutorKubelet = "kubelet"

// ContainerRuntimeExecutorPNS indicates to use process namespace sharing as the container runtime executor
ContainerRuntimeExecutorPNS = "pns"

Expand Down
5 changes: 0 additions & 5 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7512,11 +7512,6 @@ func TestGetContainerRuntimeExecutor(t *testing.T) {
executor := controller.GetContainerRuntimeExecutor(labels.Set{})
assert.Equal(t, common.ContainerRuntimeExecutorEmissary, executor)
})
t.Run("CLIParameter", func(t *testing.T) {
controller.containerRuntimeExecutor = common.ContainerRuntimeExecutorKubelet
executor := controller.GetContainerRuntimeExecutor(labels.Set{})
assert.Equal(t, common.ContainerRuntimeExecutorKubelet, executor)
})
controller.Config.ContainerRuntimeExecutor = "pns"
controller.Config.ContainerRuntimeExecutors = config.ContainerRuntimeExecutors{
{
Expand Down
21 changes: 0 additions & 21 deletions workflow/controller/workflowpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,27 +601,6 @@ func (woc *wfOperationCtx) createEnvVars() []apiv1.EnvVar {
if woc.controller.Config.Executor != nil {
execEnvVars = append(execEnvVars, woc.controller.Config.Executor.Env...)
}
switch woc.getContainerRuntimeExecutor() {
case common.ContainerRuntimeExecutorKubelet:
execEnvVars = append(execEnvVars,
apiv1.EnvVar{
Name: common.EnvVarDownwardAPINodeIP,
ValueFrom: &apiv1.EnvVarSource{
FieldRef: &apiv1.ObjectFieldSelector{
FieldPath: "status.hostIP",
},
},
},
apiv1.EnvVar{
Name: common.EnvVarKubeletPort,
Value: strconv.Itoa(woc.controller.Config.KubeletPort),
},
apiv1.EnvVar{
Name: common.EnvVarKubeletInsecure,
Value: strconv.FormatBool(woc.controller.Config.KubeletInsecure),
},
)
}
return execEnvVars
}

Expand Down
24 changes: 0 additions & 24 deletions workflow/controller/workflowpod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,30 +715,6 @@ func TestVolumeAndVolumeMounts(t *testing.T) {
},
}

// For Kubelet executor
t.Run("Kubelet", func(t *testing.T) {
ctx := context.Background()
woc := newWoc()
woc.volumes = volumes
woc.execWf.Spec.Templates[0].Container.VolumeMounts = volumeMounts
woc.controller.Config.ContainerRuntimeExecutor = common.ContainerRuntimeExecutorKubelet

tmplCtx, err := woc.createTemplateContext(wfv1.ResourceScopeLocal, "")
assert.NoError(t, err)
_, err = woc.executeContainer(ctx, woc.execWf.Spec.Entrypoint, tmplCtx.GetTemplateScope(), &woc.execWf.Spec.Templates[0], &wfv1.WorkflowStep{}, &executeTemplateOpts{})
assert.NoError(t, err)
pods, err := listPods(woc)
assert.NoError(t, err)
assert.Len(t, pods.Items, 1)
pod := pods.Items[0]
assert.Equal(t, 2, len(pod.Spec.Volumes))
assert.Equal(t, "var-run-argo", pod.Spec.Volumes[0].Name)
assert.Equal(t, "volume-name", pod.Spec.Volumes[1].Name)
assert.Equal(t, 2, len(pod.Spec.Containers[1].VolumeMounts))
assert.Equal(t, "volume-name", pod.Spec.Containers[1].VolumeMounts[0].Name)
assert.Equal(t, "var-run-argo", pod.Spec.Containers[1].VolumeMounts[1].Name)
})

// For emissary executor
t.Run("Emissary", func(t *testing.T) {
ctx := context.Background()
Expand Down
6 changes: 0 additions & 6 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,6 @@ func (we *WorkflowExecutor) SaveParameters(ctx context.Context) error {

var output *wfv1.AnyString
if we.isBaseImagePath(param.ValueFrom.Path) {
executorType := os.Getenv(common.EnvVarContainerRuntimeExecutor)
if executorType == common.ContainerRuntimeExecutorKubelet {
log.Infof("Copying output parameter %s from base image layer %s is not supported for kubelet executor. "+
"Consider using an emptyDir volume: https://argoproj.github.io/argo-workflows/empty-dir/.", param.Name, param.ValueFrom.Path)
continue
}
log.Infof("Copying %s from base image layer", param.ValueFrom.Path)
fileContents, err := we.RuntimeExecutor.GetFileContents(common.MainContainerName, param.ValueFrom.Path)
if err != nil {
Expand Down
Loading

0 comments on commit 8dbd45c

Please sign in to comment.