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

helm/web-deployment: add env vars for log level of autotrace_webhook #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions K8s/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $ helm install \

## Use with Minis

When running on `minishift` or `minikube` set `nodeport` to true. The store will then be available on the IP address of your mini and node port of the web service.
When running on `minishift` or `minikube` set `web.nodeport` to true. The store will then be available on the IP address of your mini and node port of the web service.

```shell
$ mini[kube|shift] ip
Expand All @@ -82,16 +82,17 @@ $ helm install robot-shop --set openshift=true helm

### Deployment Parameters

| Key | Default | Type | Description |
| ---------------- | ------- | ------ | ----------- |
| eum.key | null | string | EUM Access Key |
| eum.url | https://eum-eu-west-1.instana.io | url | EUM endpoint URL |
| image.pullPolicy | IfNotPresent | string | Kubernetes pull policy. One of Always,IfNotPresent, or Never. |
| image.repo | robotshop | string | Base docker repository to pull the images from. |
| image.version | latest | string | Docker tag to pull. |
| nodeport | false | booelan | Whether to expose the services via node port. |
| openshift | false | boolean | If OpenShift additional configuration is applied. |
| payment.gateway | null | string | External URL end-point to simulate partial/3rd party traces. |
| psp.enabled | false | boolean | Enable Pod Security Policy for clusters with a PSP Admission controller |
| Key | Default | Type | Description |
| ---------------- | ------- | ------ | ----------- |
| eum.key | null | string | EUM Access Key |
| eum.url | https://eum-eu-west-1.instana.io | url | EUM endpoint URL |
| image.pullPolicy | IfNotPresent | string | Kubernetes pull policy. One of Always,IfNotPresent, or Never. |
| image.repo | robotshop | string | Base docker repository to pull the images from. |
| image.version | latest | string | Docker tag to pull. |
| web.nodeport | false | boolean | Whether to expose the services via node port. |
| web.debug_autotrace | false | boolean | Whether to log in debug level the autotrace NGINX functionality |
| openshift | false | boolean | If OpenShift additional configuration is applied. |
| payment.gateway | null | string | External URL end-point to simulate partial/3rd party traces. |
| psp.enabled | false | boolean | Enable Pod Security Policy for clusters with a PSP Admission controller |
| redis.storageClassName | standard | string | Storage class to use with Redis's StatefulSet. The default for EKS is gp2. |
| ocCreateRoute | false | boolean | If you are running on OpenShift and need a Route to the web service, set this to `true` |
| ocCreateRoute | false | boolean | If you are running on OpenShift and need a Route to the web service, set this to `true` |
9 changes: 8 additions & 1 deletion K8s/helm/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ spec:
- name: web
image: {{ .Values.image.repo }}/rs-web:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.eum.key }}
{{- if or .Values.web.debug_autotrace .Values.eum.key }}
env:
{{- end}}
{{- if .Values.web.debug_autotrace }}
- name: INSTANA_LII_LOG_LEVEL
value: "debug"
- name: INSTANA_IWN_LOG_LEVEL
value: "debug"
{{- else if .Values.eum.key }}
- name: INSTANA_EUM_KEY
value: {{ .Values.eum.key }}
- name: INSTANA_EUM_REPORTING_URL
Expand Down
4 changes: 2 additions & 2 deletions K8s/helm/templates/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
targetPort: 8080
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
targetPort: 8080
{{ if .Values.web.nodeport }}
nodePort: {{ .Values.web.nodeport }}
{{ else }}
targetPort: 8080
{{ end }}

selector:
service: web
{{ if .Values.nodeport }}
{{ if .Values.web.nodeport }}
Copy link
Contributor

Choose a reason for hiding this comment

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

No change required if this is numeric.

type: NodePort
{{ else }}
type: LoadBalancer
Expand All @@ -26,4 +26,4 @@ spec:
to:
kind: Service
name: web
{{end}}
{{end}}
8 changes: 6 additions & 2 deletions K8s/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ eum:
psp:
enabled: false

# For the mini ones minikube, minishift set to true
nodeport: false

web:
# autotrace-webhook binaries to log in debug level
debug_autotrace: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
debug_autotrace: false
debugAutotrace: false

Ideally we'd maintain consistency with the rest of the config and not use snake case.

# For the mini ones minikube, minishift set to true
nodeport: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nodeport: false
nodeport: 0

Rather than a boolean I would make it a "optional" int value so the port can be adjusted to whatever the user wants. With a 0 value the nodePort would be disabled. Also Helm discourages heavy nesting. I'd probably opt for webDebugAutotrace and webNodePort. If we wanted dynamic assignment by the cluster of a nodePort then it might make sense to have a boolean and a numeric but it's probably over-engineering for a demo app.


# "special" Openshift. Set to true when deploying to any openshift flavour
openshift: false
Expand Down