Skip to content

Commit

Permalink
Remove experimental multiple-osagents-on-node feature-flag (#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
0sewa0 authored Nov 20, 2024
1 parent 5eb20dd commit 34f6bc5
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 119 deletions.
24 changes: 20 additions & 4 deletions doc/api/feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube/tmp"
## Index

- [Constants](<#constants>)
- [func MountAttemptsToTimeout(maxAttempts int) string](<#MountAttemptsToTimeout>)

## Constants

Expand All @@ -23,20 +24,22 @@ const (

// Deprecated: AnnotationFeatureDisableActiveGateUpdates use AnnotationFeatureActiveGateUpdates instead.
AnnotationFeatureDisableActiveGateUpdates = AnnotationFeaturePrefix + "disable-activegate-updates"
// Deprecated: AnnotationFeatureActiveGateIgnoreProxy use AnnotationFeatureNoProxy instead.
AnnotationFeatureActiveGateIgnoreProxy = AnnotationFeaturePrefix + "activegate-ignore-proxy"

AnnotationFeatureActiveGateUpdates = AnnotationFeaturePrefix + "activegate-updates"

AnnotationFeatureActiveGateAppArmor = AnnotationFeaturePrefix + "activegate-apparmor"
AnnotationFeatureAutomaticK8sApiMonitoring = AnnotationFeaturePrefix + "automatic-kubernetes-api-monitoring"
AnnotationFeatureAutomaticK8sApiMonitoringClusterName = AnnotationFeaturePrefix + "automatic-kubernetes-api-monitoring-cluster-name"
AnnotationFeatureK8sAppEnabled = AnnotationFeaturePrefix + "k8s-app-enabled"
AnnotationFeatureActiveGateIgnoreProxy = AnnotationFeaturePrefix + "activegate-ignore-proxy"

AnnotationFeatureNoProxy = AnnotationFeaturePrefix + "no-proxy"

AnnotationFeatureMultipleOsAgentsOnNode = AnnotationFeaturePrefix + "multiple-osagents-on-node"
// Deprecated: AnnotationFeatureOneAgentIgnoreProxy use AnnotationFeatureNoProxy instead.
AnnotationFeatureOneAgentIgnoreProxy = AnnotationFeaturePrefix + "oneagent-ignore-proxy"

AnnotationFeatureOneAgentMaxUnavailable = AnnotationFeaturePrefix + "oneagent-max-unavailable"
AnnotationFeatureOneAgentIgnoreProxy = AnnotationFeaturePrefix + "oneagent-ignore-proxy"
AnnotationFeatureOneAgentInitialConnectRetry = AnnotationFeaturePrefix + "oneagent-initial-connect-retry-ms"
AnnotationFeatureRunOneAgentContainerPrivileged = AnnotationFeaturePrefix + "oneagent-privileged"

Expand All @@ -47,19 +50,32 @@ const (
AnnotationInjectionFailurePolicy = AnnotationFeaturePrefix + "injection-failure-policy"
AnnotationFeatureInitContainerSeccomp = AnnotationFeaturePrefix + "init-container-seccomp-profile"
AnnotationFeatureEnforcementMode = AnnotationFeaturePrefix + "enforcement-mode"
AnnotationFeatureReadOnlyOneAgent = AnnotationFeaturePrefix + "oneagent-readonly-host-fs"

// CSI.
AnnotationFeatureMaxFailedCsiMountAttempts = AnnotationFeaturePrefix + "max-csi-mount-attempts"
AnnotationFeatureMaxCsiMountTimeout = AnnotationFeaturePrefix + "max-csi-mount-timeout"
AnnotationFeatureReadOnlyCsiVolume = AnnotationFeaturePrefix + "injection-readonly-volume"
)
```

<a name="DefaultMaxFailedCsiMountAttempts"></a>
<a name="DefaultMaxCsiMountTimeout"></a>

```go
const (
DefaultMaxCsiMountTimeout = "10m"
DefaultMaxFailedCsiMountAttempts = 10
DefaultMinRequestThresholdMinutes = 15
IstioDefaultOneAgentInitialConnectRetry = 6000
)
```

<a name="MountAttemptsToTimeout"></a>

## func [MountAttemptsToTimeout](<https://github.com/Dynatrace/dynatrace-operator/blob/main/pkg/api/v1beta3/dynakube/tmp/feature_flags.go#L262>)

```go
func MountAttemptsToTimeout(maxAttempts int) string
```

MountAttemptsToTimeout converts the (old) number of csi mount attempts into a time.Duration string. The converted value is based on the exponential backoff's algorithm. The output is string because it's main purpose is to convert the value of an annotation to another annotation.
158 changes: 94 additions & 64 deletions doc/e2e/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/activegate"

## Index

- [func Feature(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature](<#Feature>)
- [func Feature(t *testing.T, proxySpec *value.Source) features.Feature](<#Feature>)

<a name="Feature"></a>

## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/activegate/activegate.go#L58>)
## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/activegate/activegate.go#L59>)

```go
func Feature(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature
func Feature(t *testing.T, proxySpec *value.Source) features.Feature
```

### With proxy
Expand All @@ -34,14 +34,32 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/edgeconnect"

## Index

- [func Feature(t *testing.T) features.Feature](<#Feature>)
- [func AutomationModeFeature(t *testing.T) features.Feature](<#AutomationModeFeature>)
- [func NormalModeFeature(t *testing.T) features.Feature](<#NormalModeFeature>)
- [func ProvisionerModeFeature(t *testing.T) features.Feature](<#ProvisionerModeFeature>)

<a name="Feature"></a>
<a name="AutomationModeFeature"></a>

## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/edgeconnect/edgeconnect.go#L15>)
## func [AutomationModeFeature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/edgeconnect/edgeconnect.go#L113>)

```go
func Feature(t *testing.T) features.Feature
func AutomationModeFeature(t *testing.T) features.Feature
```

<a name="NormalModeFeature"></a>

## func [NormalModeFeature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/edgeconnect/edgeconnect.go#L36>)

```go
func NormalModeFeature(t *testing.T) features.Feature
```

<a name="ProvisionerModeFeature"></a>

## func [ProvisionerModeFeature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/edgeconnect/edgeconnect.go#L73>)

```go
func ProvisionerModeFeature(t *testing.T) features.Feature
```

# classic
Expand Down Expand Up @@ -84,6 +102,24 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/classic/switch_mod
func Feature(t *testing.T) features.Feature
```

# extensions

```go
import "github.com/Dynatrace/dynatrace-operator/test/features/extensions"
```

## Index

- [func Feature(t *testing.T) features.Feature](<#Feature>)

<a name="Feature"></a>

## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/extensions/extensions.go#L26>)

```go
func Feature(t *testing.T) features.Feature
```

# applicationmonitoring

```go
Expand All @@ -99,7 +135,7 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/applicationmonitor

<a name="LabelVersionDetection"></a>

## func [LabelVersionDetection](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/label_version_detection.go#L98>)
## func [LabelVersionDetection](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/label_version_detection.go#L99>)

```go
func LabelVersionDetection(t *testing.T) features.Feature
Expand All @@ -111,7 +147,7 @@ Verification that build labels are created and set accordingly. The test checks:

<a name="MetadataEnrichment"></a>

## func [MetadataEnrichment](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/metadata_enrichment.go#L44>)
## func [MetadataEnrichment](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/metadata_enrichment.go#L45>)

```go
func MetadataEnrichment(t *testing.T) features.Feature
Expand All @@ -121,15 +157,15 @@ Verification of the metadata enrichment part of the operator. The test checks th

<a name="ReadOnlyCSIVolume"></a>

## func [ReadOnlyCSIVolume](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/read_only_csi_volume.go#L30>)
## func [ReadOnlyCSIVolume](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/read_only_csi_volume.go#L31>)

```go
func ReadOnlyCSIVolume(t *testing.T) features.Feature
```

<a name="WithoutCSI"></a>

## func [WithoutCSI](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/without_csi.go#L22>)
## func [WithoutCSI](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/applicationmonitoring/without_csi.go#L23>)

```go
func WithoutCSI(t *testing.T) features.Feature
Expand Down Expand Up @@ -176,7 +212,7 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/support_archive"

<a name="Feature"></a>

## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/support_archive/support_archive.go#L45>)
## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/support_archive/support_archive.go#L55>)

```go
func Feature(t *testing.T) features.Feature
Expand All @@ -188,7 +224,7 @@ Verification if support-archive package created by the support-archive command a

<a name="CustomResources"></a>

## type [CustomResources](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/support_archive/support_archive.go#L35-L38>)
## type [CustomResources](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/support_archive/support_archive.go#L45-L48>)

```go
type CustomResources struct {
Expand All @@ -204,18 +240,18 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/cloudnative"

## Index

- [func AssessActiveGateContainer(builder *features.FeatureBuilder, dynakube *dynatracev1beta2.DynaKube, trustedCAs []byte)](<#AssessActiveGateContainer>)
- [func AssessActiveGateContainer(builder *features.FeatureBuilder, dk *dynakube.DynaKube, trustedCAs []byte)](<#AssessActiveGateContainer>)
- [func AssessOneAgentContainer(builder *features.FeatureBuilder, agCrt []byte, trustedCAs []byte)](<#AssessOneAgentContainer>)
- [func AssessSampleContainer(builder *features.FeatureBuilder, sampleApp *sample.App, agCrt []byte, trustedCAs []byte)](<#AssessSampleContainer>)
- [func AssessSampleInitContainers(builder *features.FeatureBuilder, sampleApp *sample.App)](<#AssessSampleInitContainers>)
- [func DefaultCloudNativeSpec() *dynatracev1beta2.CloudNativeFullStackSpec](<#DefaultCloudNativeSpec>)
- [func DefaultCloudNativeSpec() *dynakube.CloudNativeFullStackSpec](<#DefaultCloudNativeSpec>)

<a name="AssessActiveGateContainer"></a>

## func [AssessActiveGateContainer](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/container.go#L78>)

```go
func AssessActiveGateContainer(builder *features.FeatureBuilder, dynakube *dynatracev1beta2.DynaKube, trustedCAs []byte)
func AssessActiveGateContainer(builder *features.FeatureBuilder, dk *dynakube.DynaKube, trustedCAs []byte)
```

<a name="AssessOneAgentContainer"></a>
Expand All @@ -236,18 +272,18 @@ func AssessSampleContainer(builder *features.FeatureBuilder, sampleApp *sample.A

<a name="AssessSampleInitContainers"></a>

## func [AssessSampleInitContainers](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/init_containers.go#L23>)
## func [AssessSampleInitContainers](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/init_containers.go#L27>)

```go
func AssessSampleInitContainers(builder *features.FeatureBuilder, sampleApp *sample.App)
```

<a name="DefaultCloudNativeSpec"></a>

## func [DefaultCloudNativeSpec](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/init_containers.go#L82>)
## func [DefaultCloudNativeSpec](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/init_containers.go#L84>)

```go
func DefaultCloudNativeSpec() *dynatracev1beta2.CloudNativeFullStackSpec
func DefaultCloudNativeSpec() *dynakube.CloudNativeFullStackSpec
```

# network_problems
Expand Down Expand Up @@ -294,38 +330,6 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/cloudnative/upgrad
func Feature(t *testing.T) features.Feature
```

# network_zones

```go
import "github.com/Dynatrace/dynatrace-operator/test/features/cloudnative/network_zones"
```

## Index

- [func Feature(t *testing.T) features.Feature](<#Feature>)

<a name="Feature"></a>

## func [Feature](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/network_zones/network_zones.go#L53>)

```go
func Feature(t *testing.T) features.Feature
```

Feature defines the overall e2e test for testing OneAgent injection behavior when Dynatrace is configured with a network zone.

It does the following to cover the scenario of ensuring OneAgent injection is properly blocked when no ActiveGate is available, and enabled once one is added:

- Creates test a network zone via the tenant helper (can be highly destructive)
- Configures a DynaKube custom resource without an ActiveGate => no activegate == no networkzone communication
- Installs a sample application
- Verifies the sample app pods do NOT have OneAgent injected, validated via pod annotations
- Updates the DynaKube to add an ActiveGate => so now networkzone communication is possible
- Restarts the sample app pods
- Verifies the sample app pods now DO have OneAgent injected

Prerequisites: Have a tenant that has no activegates bound to it.

# codemodules

```go
Expand All @@ -335,14 +339,14 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/cloudnative/codemo
## Index

- [func InstallFromImage(t *testing.T) features.Feature](<#InstallFromImage>)
- [func WithProxy(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature](<#WithProxy>)
- [func WithProxyAndAGCert(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature](<#WithProxyAndAGCert>)
- [func WithProxyCA(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature](<#WithProxyCA>)
- [func WithProxyCAAndAGCert(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature](<#WithProxyCAAndAGCert>)
- [func WithProxy(t *testing.T, proxySpec *value.Source) features.Feature](<#WithProxy>)
- [func WithProxyAndAGCert(t *testing.T, proxySpec *value.Source) features.Feature](<#WithProxyAndAGCert>)
- [func WithProxyCA(t *testing.T, proxySpec *value.Source) features.Feature](<#WithProxyCA>)
- [func WithProxyCAAndAGCert(t *testing.T, proxySpec *value.Source) features.Feature](<#WithProxyCAAndAGCert>)

<a name="InstallFromImage"></a>

## func [InstallFromImage](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L65>)
## func [InstallFromImage](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L67>)

```go
func InstallFromImage(t *testing.T) features.Feature
Expand All @@ -352,10 +356,10 @@ Verification that the storage in the CSI driver directory does not increase when

<a name="WithProxy"></a>

## func [WithProxy](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L136>)
## func [WithProxy](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L139>)

```go
func WithProxy(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature
func WithProxy(t *testing.T, proxySpec *value.Source) features.Feature
```

Prerequisites: istio service mesh
Expand All @@ -364,30 +368,30 @@ Setup: CloudNative deployment with CSI driver

Verification that the operator and all deployed OneAgents are able to communicate over a http proxy.

Connectivity in the dynatrace namespace and sample application namespace is restricted to the local cluster. Sample application is installed. The test checks if DT_PROXY environment variable is defined in the *dynakube-oneagent* container and the *application container*.
Connectivity in the dynatrace namespace and sample application namespace is restricted to the local cluster. Sample application is installed. The test checks if DT_PROXY environment variable is defined in the *dynakubeComponents-oneagent* container and the *application container*.

<a name="WithProxyAndAGCert"></a>

## func [WithProxyAndAGCert](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L253>)
## func [WithProxyAndAGCert](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L254>)

```go
func WithProxyAndAGCert(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature
func WithProxyAndAGCert(t *testing.T, proxySpec *value.Source) features.Feature
```

<a name="WithProxyCA"></a>

## func [WithProxyCA](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L191>)
## func [WithProxyCA](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L193>)

```go
func WithProxyCA(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature
func WithProxyCA(t *testing.T, proxySpec *value.Source) features.Feature
```

<a name="WithProxyCAAndAGCert"></a>

## func [WithProxyCAAndAGCert](<https://github.com/Dynatrace/dynatrace-operator/blob/main/test/features/cloudnative/codemodules/codemodules.go#L319>)

```go
func WithProxyCAAndAGCert(t *testing.T, proxySpec *dynatracev1beta2.DynaKubeProxy) features.Feature
func WithProxyCAAndAGCert(t *testing.T, proxySpec *value.Source) features.Feature
```

# _default
Expand Down Expand Up @@ -467,3 +471,29 @@ import "github.com/Dynatrace/dynatrace-operator/test/features/cloudnative/switch
```go
func Feature(t *testing.T) features.Feature
```

# consts

```go
import "github.com/Dynatrace/dynatrace-operator/test/features/consts"
```

## Index

- [Constants](<#constants>)

## Constants

<a name="AgCertificate"></a>

```go
const (
AgCertificate = "custom-cas/agcrt.pem"
AgCertificateAndPrivateKey = "custom-cas/agcrtkey.p12"
AgCertificateAndPrivateKeyField = "server.p12"
AgSecretName = "ag-ca"
DevRegistryPullSecretName = "devregistry"
EecImageRepo = "478983378254.dkr.ecr.us-east-1.amazonaws.com/dynatrace/dynatrace-eec"
EecImageTag = "1.303.0.20240930-183404"
)
```
2 changes: 1 addition & 1 deletion hack/doc/gen_feature_flags.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
gomarkdoc_header="<!-- Code generated by gomarkdoc. DO NOT EDIT -->"
script_header="<!-- Code generated by ./hack/doc/gen_feature_flags.sh - DO NOT EDIT -->"
doc_dir="./pkg/api/v1beta2/dynakube"
doc_dir="./pkg/api/v1beta3/dynakube"
output_dir="./doc/api"
output_file="feature-flags.md"
output=""
Expand Down
Loading

0 comments on commit 34f6bc5

Please sign in to comment.