-
Notifications
You must be signed in to change notification settings - Fork 183
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
Pre-install hook for helm #176
Changes from 7 commits
f7f47e4
c28670d
9692e0f
1167431
3bdf39d
f15f590
1905f2f
468357c
3ad790e
4b3430f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM alpine:3.9 | ||
|
||
RUN apk add --no-cache gnupg | ||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache jq | ||
|
||
# Install kubectl | ||
ADD https://storage.googleapis.com/kubernetes-release/release/v1.6.12/bin/linux/amd64/kubectl /usr/local/bin/kubectl | ||
RUN chmod +x /usr/local/bin/kubectl | ||
maimaisie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
COPY setup.sh /usr/bin/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{- if .Values.sumologic.setupEnabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "sumologic.fullname" . }}-init | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install | ||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded | ||
labels: | ||
app: {{ template "sumologic.labels.app" . }} | ||
{{ template "sumologic.labels.common" . }} | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: setup | ||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: ["/usr/bin/setup.sh", | ||
"-n", "{{ .Release.Namespace }}", | ||
"-k", "{{ .Values.sumologic.clusterName }}", | ||
{{- if .Values.sumologic.collectorName }} | ||
"-c", "{{ .Values.sumologic.collectorName }}", | ||
{{- end }} | ||
"-d", "false", | ||
"-y", "false", | ||
'{{ required "A valid .Values.sumologic.endpoint entry required!" .Values.sumologic.endpoint }}', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are your thoughts on instead of using the full URL, we let the customer specify the deployment name (e.g. US2)? We then do a conditional block rendering the right URL based on what they selected and can fail if they make an invalid choice. This makes it easier for people, other various open-source Sumo projects work with this way. We have to occasionally update that as we add new deployments, but that seems minor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be more maintenance work and I think we generally try to avoid it because it's easily forgotten. What are your thoughts on this @lei-sumo @samjsong @rvmiller89 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with documenting it in our steps for now. |
||
'{{ required "A valid .Values.sumologic.accessId entry required!" .Values.sumologic.accessId }}', | ||
'{{ required "A valid .Values.sumologic.accessKey entry required!" .Values.sumologic.accessKey }}'] | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,26 @@ eventsDeployment: | |
cpu: "100m" | ||
|
||
sumologic: | ||
## Setup | ||
|
||
# If enabled, a pre-install hook will create Collector and Sources in Sumo Logic | ||
setupEnabled: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we make the default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are commenting out access id, key and endpoint because they are required values with no defaults. When we reference them here , we use the
The collector name is commented out because the script has the default value, so we don't need to specify it again here |
||
|
||
# Sumo access ID | ||
#accessId: "" | ||
|
||
# Sumo access key | ||
#accesskey: "" | ||
|
||
# Sumo API endpoint | ||
#endpoint: "" | ||
|
||
# Collector name | ||
#collectorName: "" | ||
|
||
# Cluster name | ||
clusterName: "kubernetes" | ||
|
||
|
||
## Format to post logs into Sumo. json, json_merge, or text | ||
logFormat: fields | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this version too low?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to 1.15.0 according to their doc page