Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override stackdriver endpoint in event-exporter in test cluster #81681

Merged
merged 1 commit into from Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions cluster/addons/fluentd-gcp/event-exporter.yaml
Expand Up @@ -29,32 +29,32 @@ subjects:
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-exporter-v0.2.5
name: event-exporter-v0.3.0
namespace: kube-system
labels:
k8s-app: event-exporter
version: v0.2.5
version: v0.3.0
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
spec:
replicas: 1
selector:
matchLabels:
k8s-app: event-exporter
version: v0.2.5
version: v0.3.0
template:
metadata:
labels:
k8s-app: event-exporter
version: v0.2.5
version: v0.3.0
spec:
serviceAccountName: event-exporter-sa
containers:
- name: event-exporter
image: k8s.gcr.io/event-exporter:v0.2.5
image: k8s.gcr.io/event-exporter:v0.3.0
command:
- /event-exporter
- -sink-opts=-stackdriver-resource-model={{ exporter_sd_resource_model }}
- -sink-opts=-stackdriver-resource-model={{ exporter_sd_resource_model }} -endpoint={{ exporter_sd_endpoint }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not going to be translated to:
/event-exporter -sink-opts=-stackdriver-resource-model={{ exporter_sd_resource_model }} -endpoint={{ exporter_sd_endpoint }}

I think we need to change it to:
/event-exporter -sink-opts="-stackdriver-resource-model={{ exporter_sd_resource_model }} -endpoint={{ exporter_sd_endpoint }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some experiments by adding some glog.Warning after this line.
The above command is translated to:
./event-exporter "-sink-opts=-stackdriver-resource-model={{ exporter_sd_resource_model }} -endpoint={{ exporter_sd_endpoint }}"
Which is equivalent to
./event-exporter -sink-opts="-stackdriver-resource-model={{ exporter_sd_resource_model }} -endpoint={{ exporter_sd_endpoint }}"

# BEGIN_PROMETHEUS_TO_SD
- name: prometheus-to-sd-exporter
image: k8s.gcr.io/prometheus-to-sd:v0.5.0
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/gci/configure-helper.sh
Expand Up @@ -2547,6 +2547,7 @@ function update-daemon-set-prometheus-to-sd-parameters {
function update-event-exporter {
local -r stackdriver_resource_model="${LOGGING_STACKDRIVER_RESOURCE_TYPES:-old}"
sed -i -e "s@{{ exporter_sd_resource_model }}@${stackdriver_resource_model}@g" "$1"
sed -i -e "s@{{ exporter_sd_endpoint }}@${STACKDRIVER_TEST_ENDPOINT:-}@g" "$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used anywhere. There should be some default value specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used anywhere.

I assume you're referring to STACKDRIVER_TEST_ENDPOINT? This is a kube-env var I added (CL just submitted).

There should be some default value specified.

The default value for exporter_sd_endpoint according to the above logic is just empty, which leaves the param -endpoint empty. This makes event-exporter creates a Service with the default prod endpoint. That's why I'm not specifically put the prod url in the default value.

}

function update-dashboard-controller {
Expand Down