-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add Parquet-Exporter helm chart #195
Open
cklingspor
wants to merge
9
commits into
opencost:main
Choose a base branch
from
cklingspor:add_parquet_exporter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
da5333d
Initial commit. Moved from https://github.com/opencost/opencost-parqu…
cklingspor fd08d91
Remove .DS_Store from tracking, add .gitignore
cklingspor 683ee01
Mark 'serviceAccount' key/value pair as optional in description, move…
cklingspor 7077a2d
Merge branch 'main' into add_parquet_exporter
cklingspor 633facf
Rename serviceAccount to existingServiceAccount, make sure its only u…
cklingspor 542bdc0
Reflect chart renaming in _helpers.tpl & _annotations.tpl
cklingspor 04783c0
Merge branch 'main' into add_parquet_exporter
mattray 914de43
Merge branch 'main' into add_parquet_exporter
cklingspor 9000ec0
Remove trailing spaces
cklingspor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
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,24 @@ | ||
apiVersion: v2 | ||
name: opencost-parquet-exporter | ||
description: OpenCost Parquet Exporter | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
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,38 @@ | ||
# opencost-parquet-exporter | ||
|
||
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) | ||
|
||
OpenCost Parquet Exporter | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| activeDeadlineSeconds | int | `3600` | Keep job running (from start time) for [activeDeadlineSeconds] | | ||
| awsRolename | string | `"testrole"` | AWS IAM role to use when writing to the S3 Bucket. | | ||
| concurrencyPolicy | string | `"Forbid"` | Do not allow multiple runs | | ||
| dnsConfig | object | `{"options":[{"name":"single-request-reopen"},{"name":"ndots","value":"2"}]}` | Specific DNS parameters of the pod | | ||
| dnsConfig.options[0] | object | `{"name":"single-request-reopen"}` | Turning this option on [...] so that if two requests from the same port are not handled correctly it will close the socket and open a new one before sending the second request. See also "[single-request-reopen](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)" | | ||
| dnsConfig.options[1] | object | `{"name":"ndots","value":"2"}` | Sets a threshold for the number of dots which must appear in a name [...] before an initial absolute query will be made. . See also "[ndots](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)" | | ||
| dnsPolicy | string | `"ClusterFirst"` | A pod's [DNS polics](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) | | ||
| env | list | `[{"name":"AWS_REGION","value":"us-west-2"},{"name":"KUBE_CLUSTER","value":"YOUR_CLUSTER_NAME_CHANGE_ME"},{"name":"OPENCOST_PARQUET_FILE_KEY_PREFIX","value":"cluster=$(KUBE_CLUSTER)"},{"name":"OPENCOST_PARQUET_S3_BUCKET","value":"YOUR_S3_BUCKET_NAME_CHANGE_ME"},{"name":"OPENCOST_PARQUET_S3_REGION","value":"YOUR_S3_BUCKET_REGION_NAME_CHANGE_ME"},{"name":"OPENCOST_PARQUET_SVC_HOSTNAME","value":"opencost.opencost.svc.cluster.local"},{"name":"OPENCOST_PARQUET_SVC_PORT","value":"9003"}]` | List of env vars | | ||
| envFrom | string | `nil` | | | ||
| existingServiceAccount | string | `nil` | Optional ServiceAccount use to run this pod | | ||
| failedJobsHistoryLimit | int | `3` | Keep up to three failed jobs | | ||
| image.imagePullPolicy | string | `"Always"` | | | ||
| image.repository | string | `"ghcr.io/opencost/opencost-parquet-exporter"` | | | ||
| image.tag | string | `"main"` | | | ||
| resources | object | `{"limits":{"cpu":2,"memory":"5Gi"},"requests":{"cpu":1,"memory":"1Gi"}}` | Compute resources required | | ||
| restartPolicy | string | `"Never"` | | | ||
| schedule | string | `"* * * * *"` | Schedule on which to run the cron job | | ||
| securityContext.capabilities.drop[0] | string | `"ALL"` | | | ||
| securityContext.readOnlyRootFilesystem | bool | `true` | | | ||
| securityContext.runAsNonRoot | bool | `true` | | | ||
| securityContext.runAsUser | int | `1001` | | | ||
| successfulJobsHistoryLimit | int | `3` | Keep up to three successful jobs | | ||
| suspend | bool | `false` | | | ||
| terminationGracePeriodSeconds | int | `30` | | | ||
| ttlSecondsAfterFinished | int | `14400` | Limit the lifetime of the execution | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.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,8 @@ | ||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "parquet-exporter.annotations" -}} | ||
{{- if .Values.awsRolename }} | ||
iam.amazonaws.com/role: {{ .Values.awsRolename }} | ||
{{- end }} | ||
{{- end }} |
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,51 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "opencost-parquet-exporter.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "opencost-parquet-exporter.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "opencost-parquet-exporter.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "opencost-parquet-exporter.labels" -}} | ||
helm.sh/chart: {{ include "opencost-parquet-exporter.chart" . }} | ||
{{ include "opencost-parquet-exporter.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "opencost-parquet-exporter.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "opencost-parquet-exporter.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
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,73 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ include "opencost-parquet-exporter.name" $ }} | ||
annotations: | ||
{{- include "parquet-exporter.annotations" $ | indent 4 }} | ||
labels: | ||
{{ include "opencost-parquet-exporter.labels" . | indent 4 }} | ||
spec: | ||
concurrencyPolicy: {{ .Values.concurrencyPolicy | quote}} | ||
failedJobsHistoryLimit: {{ .Values.failedJobsHistoryLimit }} | ||
schedule: {{ .Values.schedule | quote}} | ||
successfulJobsHistoryLimit: {{ .Values.successfulJobsHistoryLimit }} | ||
suspend: {{ .Values.suspend }} | ||
jobTemplate: | ||
metadata: | ||
name: {{ include "opencost-parquet-exporter.name" $ }} | ||
spec: | ||
activeDeadlineSeconds: {{ .Values.activeDeadlineSeconds }} | ||
ttlSecondsAfterFinished: {{ .Values.ttlSecondsAfterFinished }} | ||
backoffLimit: 3 | ||
template: | ||
metadata: | ||
annotations: | ||
{{- include "parquet-exporter.annotations" $ | indent 12 }} | ||
labels: | ||
{{ include "opencost-parquet-exporter.labels" . | indent 12 }} | ||
name: {{ include "opencost-parquet-exporter.name" $ }} | ||
spec: | ||
{{- if .Values.imagePullSecrets }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if not ( .Values.existingServiceAccount | empty ) }} | ||
serviceAccountName: {{ .Values.existingServiceAccount }} | ||
{{- end }} | ||
{{- if hasKey .Values "securityContext" }} | ||
{{- with .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- else}} | ||
securityContext: {} | ||
{{- end }} | ||
containers: | ||
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.image.imagePullPolicy }} | ||
name: {{ include "opencost-parquet-exporter.name" $ }} | ||
{{- with .Values.resources }} | ||
resources: | ||
{{ toYaml . | indent 16 }} | ||
{{- end }} | ||
{{- with .Values.env }} | ||
env: | ||
{{ toYaml . | indent 16 }} | ||
{{- end }} | ||
{{- with .Values.envFrom }} | ||
envFrom: | ||
{{ toYaml . | indent 16 }} | ||
{{- end }} | ||
{{- with .Values.dnsConfig }} | ||
dnsConfig: | ||
{{ toYaml . | indent 12 }} | ||
{{- end }} | ||
{{- if .Values.dnsPolicy}} | ||
dnsPolicy: {{ .Values.dnsPolicy }} | ||
{{- end }} | ||
restartPolicy: {{ .Values.restartPolicy }} | ||
{{- if .Values.terminationGracePeriodSeconds }} | ||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds}} | ||
{{- end }} |
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,65 @@ | ||
# -- AWS IAM role to use when writing to the S3 Bucket. | ||
awsRolename: testrole | ||
# -- Do not allow multiple runs | ||
concurrencyPolicy: Forbid | ||
# -- Keep up to three failed jobs | ||
failedJobsHistoryLimit: 3 | ||
# -- Schedule on which to run the cron job | ||
schedule: "* * * * *" | ||
# -- Keep up to three successful jobs | ||
successfulJobsHistoryLimit: 3 | ||
suspend: false | ||
# -- Keep job running (from start time) for [activeDeadlineSeconds] | ||
activeDeadlineSeconds: 3600 | ||
# -- Limit the lifetime of the execution | ||
ttlSecondsAfterFinished: 14400 | ||
# -- Optional ServiceAccount use to run this pod | ||
existingServiceAccount: | ||
securityContext: | ||
runAsUser: 1001 | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
image: | ||
repository: ghcr.io/opencost/opencost-parquet-exporter | ||
tag: main | ||
imagePullPolicy: Always | ||
# -- List of env vars | ||
env: | ||
- name: AWS_REGION | ||
value: us-west-2 | ||
- name: KUBE_CLUSTER | ||
value: YOUR_CLUSTER_NAME_CHANGE_ME | ||
- name: OPENCOST_PARQUET_FILE_KEY_PREFIX | ||
value: cluster=$(KUBE_CLUSTER) | ||
- name: OPENCOST_PARQUET_S3_BUCKET | ||
value: YOUR_S3_BUCKET_NAME_CHANGE_ME | ||
- name: OPENCOST_PARQUET_S3_REGION | ||
value: YOUR_S3_BUCKET_REGION_NAME_CHANGE_ME | ||
- name: OPENCOST_PARQUET_SVC_HOSTNAME | ||
value: opencost.opencost.svc.cluster.local | ||
- name: OPENCOST_PARQUET_SVC_PORT | ||
value: "9003" | ||
envFrom: | ||
# -- Compute resources required | ||
resources: | ||
limits: | ||
cpu: 2 | ||
memory: 5Gi | ||
requests: | ||
cpu: 1 | ||
memory: 1Gi | ||
# -- Specific DNS parameters of the pod | ||
dnsConfig: | ||
options: | ||
# -- Turning this option on [...] so that if two requests from the same port are not handled correctly it will close the socket and open a new one before sending the second request. See also "[single-request-reopen](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)" | ||
- name: single-request-reopen | ||
# -- Sets a threshold for the number of dots which must appear in a name [...] before an initial absolute query will be made. . See also "[ndots](https://man7.org/linux/man-pages/man5/resolv.conf.5.html)" | ||
- name: ndots | ||
value: "2" | ||
# -- A pod's [DNS polics](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Never | ||
terminationGracePeriodSeconds: 30 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
do the "parquet-exporter" references need to be changed to "opencost-parquest-exporter" across the board?
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.
It would be consistent with actual chart name. I'll update accordingly
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.
Done