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

Generate labels and names using helm templates #685

Merged
merged 27 commits into from May 28, 2020
Merged

Conversation

sumo-drosiek
Copy link
Contributor

Description

The purpose is to not lost track of relations between kubernetes objects

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@sumo-drosiek sumo-drosiek added this to the v1.1 milestone May 27, 2020
Copy link
Contributor

@frankreno frankreno left a comment

Choose a reason for hiding this comment

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

This is nice and clean, LGTM

selector:
matchLabels:
app: collection-sumologic-fluentd-logs
sumologic/app: fluentd-logs
- name: collection-sumologic-fluentd-metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

Shoudl we leverage these on the ServiceMonitor name and labels (not the selector labels but the labels for the ServiceMonitor as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the purpose of those labels? Do we use them anywhere in the sumologic?

Copy link
Contributor

Choose a reason for hiding this comment

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

It’s more consistency. Should we be consistent about the label usage across all things we install.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I read additionalLabels as "labels which will be added as dimension to the metric"

@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "sumologic.fullname" . }}-fluentd-logs
name: {{ template "sumologic.metadata.name.logs" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will be more meaningfull if we use configmap at the end
so the full name will be:
sumologic.metadata.name.logs.configmap

Given that Helm is stringly typed it will be easier to reason about what is being used where.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@perk-sumo perk-sumo linked an issue May 27, 2020 that may be closed by this pull request
annotations:
{{ toYaml .Values.sumologic.setup.serviceAccount.annotations | indent 4 }}
labels:
app: {{ template "sumologic.labels.app" . }}
app: {{ template "sumologic.labels.app.roles.serviceaccount" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

sumologic.labels.app.setup.roles.serviceaccount

annotations:
{{ toYaml .Values.sumologic.setup.clusterRole.annotations | indent 4 }}
labels:
app: {{ template "sumologic.labels.app" . }}
app: {{ template "sumologic.labels.app.roles.clusterrole" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

sumologic.labels.app.setup.roles.clusterrole?

annotations:
{{ toYaml .Values.sumologic.setup.clusterRoleBinding.annotations | indent 4 }}
labels:
app: {{ template "sumologic.labels.app" . }}
app: {{ template "sumologic.labels.app.roles.clusterrolebinding" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

sumologic.labels.app.setup.roles.clusterrolebinding?

{{- include "sumologic.labels.common" . | nindent 8 }}
spec:
serviceAccountName: {{ template "sumologic.fullname" . }}
serviceAccountName: {{ template "sumologic.metadata.name.roles.serviceaccount" . }}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

{{- template "sumologic.labels.app.setup" . }}
{{- end -}}

{{- define "sumologic.labels.app.setup.rolesserviceaccount" -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

sumologic.labels.app.setup.roles.serviceaccount?

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

Some fixes are needed but overall IMO it's great and this will make refactoring a lot easier.

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@perk-sumo perk-sumo merged commit bea1ba1 into master May 28, 2020
@perk-sumo perk-sumo deleted the drosiek-gen-labels branch May 28, 2020 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create helm templates for app names and labels
4 participants