forked from jaegertracing/jaeger-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: webhook deadlock (jaegertracing#1850)
* introduce recommended common label for app name Signed-off-by: Benedikt Bongartz <[email protected]> * exclude deployments named jaeger-operator from the injection webhook Signed-off-by: Benedikt Bongartz <[email protected]> * change deployment webhook failurePolicy to ignore Signed-off-by: Benedikt Bongartz <[email protected]> * regenerate manifest and bundle Signed-off-by: Benedikt Bongartz <[email protected]> * test webhook deployment exception on app name Signed-off-by: Benedikt Bongartz <[email protected]> Co-authored-by: Ruben Vargas <[email protected]>
- Loading branch information
1 parent
3e456b7
commit d60fada
Showing
19 changed files
with
149 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: MutatingWebhookConfiguration | ||
metadata: | ||
name: mutating-webhook-configuration | ||
webhooks: | ||
- name: deployment.sidecar-injector.jaegertracing.io | ||
objectSelector: # Skip resources with the name jaeger-operator | ||
matchExpressions: | ||
- key: app.kubernetes.io/name | ||
operator: NotIn | ||
values: | ||
- "jaeger-operator" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: agent-as-sidecar | ||
spec: | ||
replicas: 1 | ||
status: | ||
readyReplicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: jaegertracing.io/v1 | ||
kind: Jaeger | ||
metadata: | ||
name: agent-as-sidecar | ||
spec: | ||
strategy: allinone | ||
allInOne: | ||
options: | ||
log-level: "debug" | ||
memory.max-traces: 10000 | ||
ingress: | ||
enabled: true | ||
security: "none" | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: ./annotate-ns.sh | ||
namespaced: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: vertx-create-span-sidecar | ||
spec: | ||
containers: | ||
- name: vertx-create-span-sidecar | ||
status: | ||
phase: Running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: vertx-create-span-sidecar | ||
spec: | ||
containers: | ||
- name: vertx-create-span-sidecar | ||
status: | ||
phase: Running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: vertx-create-span-sidecar | ||
annotations: | ||
"sidecar.jaegertracing.io/inject": "true" | ||
labels: | ||
# deployment should not pass the webhook - no sidecar gets injected | ||
"app.kubernetes.io/name": "jaeger-operator" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: vertx-create-span-sidecar | ||
template: | ||
metadata: | ||
labels: | ||
app: vertx-create-span-sidecar | ||
spec: | ||
containers: | ||
- name: vertx-create-span-sidecar | ||
image: "jaegertracing/vertx-create-span:operator-e2e-tests" | ||
ports: | ||
- containerPort: 8080 | ||
readinessProbe: | ||
httpGet: | ||
path: "/" | ||
port: 8080 | ||
initialDelaySeconds: 1 | ||
periodSeconds: 1 | ||
livenessProbe: | ||
httpGet: | ||
path: "/" | ||
port: 8080 | ||
initialDelaySeconds: 1 | ||
periodSeconds: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
PARAMS="" | ||
NAMESPACE="" | ||
while (( "$#" )); do | ||
case "$1" in | ||
-n|--namespace) | ||
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then | ||
NAMESPACE=$2 | ||
shift 2 | ||
else | ||
echo "Error: Argument for $1 is missing" >&2 | ||
exit 1 | ||
fi | ||
;; | ||
-*|--*=) # unsupported flags | ||
echo "Error: Unsupported flag $1" >&2 | ||
exit 1 | ||
;; | ||
*) # preserve positional arguments | ||
PARAMS="$PARAMS $1" | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
kubectl annotate --overwrite namespaces ${NAMESPACE} "sidecar.jaegertracing.io/inject"="true" |