File tree 10 files changed +57
-6
lines changed
tests/e2e/daemonset-features
10 files changed +57
-6
lines changed Original file line number Diff line number Diff line change 5
5
# you can just add --addons "metrics-server" to the start command.
6
6
7
7
8
- if [[ " $( kubectl api-resources) " =~ " openshift" ]]; then
8
+ if [[ " $( kubectl api-resources --api-group=operator. openshift.io -o name ) " ]]; then
9
9
echo " Connected to an OpenShift cluster. metrics-server installation is not needed"
10
10
elif [[ " $( kubectl get deployment metrics-server -n kube-system 2>&1 ) " =~ " NotFound" ]]; then
11
11
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- if [[ " $( kubectl api-resources) " =~ " openshift" ]]; then
3
+ if [[ " $( kubectl api-resources --api-group=operator. openshift.io -o name ) " ]]; then
4
4
echo " Connected to an OpenShift cluster. OpenShift routes installation is not needed"
5
5
else
6
6
kubectl apply -f https://raw.githubusercontent.com/openshift/router/release-4.12/deploy/router_rbac.yaml
Original file line number Diff line number Diff line change
1
+ apiVersion : kuttl.dev/v1beta1
2
+ kind : TestStep
3
+ commands :
4
+ - script : ./add-scc-openshift.sh
Original file line number Diff line number Diff line change 1
1
apiVersion : opentelemetry.io/v1alpha1
2
2
kind : OpenTelemetryCollector
3
3
metadata :
4
- name : daemonset
4
+ name : daemonset
5
5
spec :
6
- mode : daemonset
6
+ mode : daemonset
7
7
hostNetwork : true
8
8
config : |
9
9
receivers:
Original file line number Diff line number Diff line change 10
10
- args :
11
11
- --config=/conf/collector.yaml
12
12
name : otc-container
13
- status :
14
- numberReady : 1
Original file line number Diff line number Diff line change
1
+ apiVersion : kuttl.dev/v1beta1
2
+ kind : TestStep
3
+ commands :
4
+ - script : ./add-sa-collector.sh
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Pod
3
+ metadata :
4
+ labels :
5
+ app.kubernetes.io/name : daemonset-collector
6
+ app.kubernetes.io/part-of : opentelemetry
7
+ status :
8
+ phase : Running
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if [[ " $( kubectl api-resources --api-group=operator.openshift.io -o name) " ]]; then
3
+ echo " Adding service account to the OpenTelemetry Collector"
4
+ kubectl patch otelcol daemonset --type=merge -p ' {"spec":{"serviceAccount":"otel-collector-daemonset"}}' -n $NAMESPACE
5
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if [[ " $( kubectl api-resources --api-group=operator.openshift.io -o name) " ]]; then
3
+ echo " Running the test against an OpenShift Cluster"
4
+ echo " Creating an Service Account"
5
+ echo " Creating a Security Context Constrain"
6
+ echo " Setting the Service Account for the Daemonset"
7
+ echo " Adding the new policy to the Service Account"
8
+ kubectl apply -f scc.yaml -n $NAMESPACE
9
+ oc adm policy add-scc-to-user -z otel-collector-daemonset daemonset-with-hostport -n $NAMESPACE
10
+ fi
Original file line number Diff line number Diff line change
1
+ kind : SecurityContextConstraints
2
+ apiVersion : security.openshift.io/v1
3
+ metadata :
4
+ name : daemonset-with-hostport
5
+ annotations :
6
+ kubernetes.io/description : ' Allows DaemonSets to bind to a well-known host port'
7
+ runAsUser :
8
+ type : RunAsAny
9
+ seLinuxContext :
10
+ type : RunAsAny
11
+ allowHostPorts : true
12
+ allowHostDirVolumePlugin : false
13
+ allowHostIPC : false
14
+ allowHostNetwork : true
15
+ allowHostPID : false
16
+ allowPrivilegedContainer : false
17
+ readOnlyRootFilesystem : false
18
+ ---
19
+ apiVersion : v1
20
+ kind : ServiceAccount
21
+ metadata :
22
+ name : otel-collector-daemonset
You can’t perform that action at this time.
0 commit comments