-
Notifications
You must be signed in to change notification settings - Fork 17
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
[charts/cosi] add COSI driver helm chart #267
Merged
Merged
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
df51de1
add cosi driver helm chart
mdutka-dell 85886a6
add cosi specific linters
mdutka-dell acb8d3d
remove go mod from cosi linters
mdutka-dell 1b1aea4
fix typos
mdutka-dell ff20466
add cosi-ct-config.yaml
mdutka-dell 08b6b06
change workflow name
mdutka-dell 9b2f24c
change log levels in cosi chart
mdutka-dell 0068140
update actions
mdutka-dell 1279038
change name from cosi-driver to cosi
mdutka-dell acd938d
Merge branch 'release-v1.8.0' into add_cosi_driver
mdutka-dell c07128b
add kubelinter for all charts
mdutka-dell 3d079b8
Merge branch 'add_cosi_driver' of https://github.com/dell/helm-charts…
mdutka-dell b665359
revert kubelinter
mdutka-dell aeb8fb3
change log levels in chart's template
mdutka-dell c869ef2
Merge branch 'release-v1.8.0' into add_cosi_driver
mdutka-dell 8357564
Merge branch 'release-v1.8.0' into add_cosi_driver
mdutka-dell 3b35296
Merge branch 'release-v1.8.0' into add_cosi_driver
mdutka-dell 3126f29
Merge branch 'release-v1.8.0' into add_cosi_driver
mtrajfacki-dell 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,29 @@ | ||
name: COSI driver | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ["**"] | ||
|
||
env: | ||
GOPRIVATE: github.com/dell/* | ||
TOKEN: ${{ secrets.GH_DELL_ACCESS }} | ||
|
||
jobs: | ||
kube-linter: | ||
name: Kube Linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure git for private modules | ||
run: | | ||
git config --global url."https://csmbot:[email protected]".insteadOf "https://github.com" | ||
echo "machine github.com login csmbot password $TOKEN" >> ~/.netrc | ||
- name: Checkout the code | ||
uses: actions/[email protected] | ||
- name: Scan repo with kube-linter | ||
uses: stackrox/[email protected] | ||
with: | ||
directory: charts/cosi | ||
config: kubelinter-config.yaml | ||
|
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,36 @@ | ||
# Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License | ||
|
||
apiVersion: v2 | ||
name: cosi | ||
description: Container Object Storage Interface (COSI) Driver for Dell ObjectScale | ||
|
||
# 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.0.0-alpha |
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,5 @@ | ||
Thank you for installing {{ .Chart.Name }}. | ||
|
||
Your release is named {{ .Release.Name }}. | ||
|
||
For more information visit CSM documentation: https://dell.github.io/csm-docs/ |
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,183 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "cosi.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 "cosi.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 "cosi.chart" }} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
# COSI driver log level | ||
# Possible values: "trace" "debug" "info" "warn" "error" "fatal" "panic" | ||
# Default value: "debug" | ||
*/}} | ||
{{- define "cosi.logLevel" }} | ||
{{- $logLevelValues := list "trace" "debug" "info" "warn" "error" "fatal" "panic" }} | ||
{{- if (has .Values.provisioner.logLevel $logLevelValues) }} | ||
{{- .Values.provisioner.logLevel }} | ||
{{- else }} | ||
{{- "debug" }} | ||
{{- end }} | ||
{{- end }} | ||
mdutka-dell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{/* | ||
# COSI driver sidecar log level | ||
# Values are set to the integer value, higher value means more verbose logging | ||
*/}} | ||
{{- define "cosi.provisionerSidecarVerbosity" }} | ||
{{- if (kindIs "int" .Values.sidecar.verbosity) }} | ||
{{- .Values.sidecar.verbosity }} | ||
{{- else }} | ||
{{- 5 }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
# COSI driver log format | ||
# Possible values: "json" "text" | ||
# Default value: "json" | ||
*/}} | ||
{{- define "cosi.logFormat" }} | ||
{{- $logFormatValues := list "json" "text" }} | ||
{{- if (has .Values.provisioner.logFormat $logFormatValues) }} | ||
{{- .Values.provisioner.logFormat }} | ||
{{- else }} | ||
{{- "text" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
# COSI driver OTEL endpoint | ||
# Default value is left empty on purpose, to not start any tracing if no argument was provided. | ||
# Default value: "" | ||
*/}} | ||
{{- define "cosi.otelEndpoint" }} | ||
{{- if .Values.provisioner.otelEndpoint }} | ||
{{- .Values.provisioner.otelEndpoint }} | ||
{{- else }} | ||
{{- "" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "cosi.labels" }} | ||
helm.sh/chart: {{ include "cosi.chart" . }} | ||
{{- include "cosi.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "cosi.selectorLabels" }} | ||
app.kubernetes.io/name: {{ include "cosi.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the role to use | ||
*/}} | ||
{{- define "cosi.roleName" }} | ||
{{- if and .Values.rbac.create }} | ||
{{- default (printf "%s" (include "cosi.fullname" .)) .Values.rbac.role.name }} | ||
{{- else }} | ||
{{- .Values.rbac.role.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the role binding to use | ||
*/}} | ||
{{- define "cosi.roleBindingName" }} | ||
{{- if and .Values.rbac.create }} | ||
{{- default (printf "%s" (include "cosi.fullname" .)) .Values.rbac.roleBinding.name }} | ||
{{- else }} | ||
{{- .Values.rbac.roleBinding.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "cosi.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "cosi.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of provisioner container | ||
*/}} | ||
{{- define "cosi.provisionerContainerName" }} | ||
{{- default "objectstorage-provisioner" .Values.provisioner.name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of provisioner sidecar container | ||
*/}} | ||
{{- define "cosi.provisionerSidecarContainerName" }} | ||
{{- default "objectstorage-provisioner-sidecar" .Values.sidecar.name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the full name of provisioner image from repository and tag | ||
*/}} | ||
{{- define "cosi.provisionerImageName" }} | ||
{{- .Values.provisioner.image.repository }}:{{ .Values.provisioner.image.tag | default .Chart.AppVersion }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the full name of provisioner sidecar image from repository and tag | ||
*/}} | ||
{{- define "cosi.provisionerSidecarImageName" }} | ||
{{- .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the secret name | ||
*/}} | ||
{{- define "cosi.secretName" }} | ||
{{- if .Values.configuration.create }} | ||
{{- default (printf "%s-config" (include "cosi.name" . )) .Values.configuration.secretName }} | ||
{{- else }} | ||
{{- .Values.configuration.secretName }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name for secret volume | ||
*/}} | ||
{{- define "cosi.secretVolumeName" }} | ||
{{- printf "%s-config" (include "cosi.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,90 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "cosi.fullname" . }} | ||
labels: | ||
{{- include "cosi.labels" . | trim | nindent 4 }} | ||
{{- with .Values.rbac.role.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "cosi.selectorLabels" . | trim | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "cosi.labels" . | trim | nindent 8 }} | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "cosi.serviceAccountName" . }} | ||
{{- with .Values.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ include "cosi.provisionerContainerName" . }} | ||
{{- with .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
image: {{ include "cosi.provisionerImageName" . }} | ||
imagePullPolicy: {{ .Values.provisioner.image.pullPolicy }} | ||
args: | ||
- "--log-level={{ include "cosi.logLevel" . }}" | ||
- "--log-format={{ include "cosi.logFormat" . }}" | ||
- "--otel-endpoint={{ include "cosi.otelEndpoint" . }}" | ||
{{- with .Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: {{ include "cosi.secretVolumeName" . }} | ||
mountPath: /cosi | ||
- name: cosi-socket-dir | ||
mountPath: /var/lib/cosi | ||
- name: {{ include "cosi.provisionerSidecarContainerName" . }} | ||
image: {{ include "cosi.provisionerSidecarImageName" . }} | ||
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }} | ||
args: | ||
- "-v={{ include "cosi.provisionerSidecarVerbosity" . }}" | ||
{{- with .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: cosi-socket-dir | ||
mountPath: /var/lib/cosi | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: {{ include "cosi.secretVolumeName" . }} | ||
secret: | ||
secretName: {{ include "cosi.secretName" . }} | ||
- name: cosi-socket-dir | ||
emptyDir: {} |
Oops, something went wrong.
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.
There is an existing linter used for all charts located here: https://github.com/dell/helm-charts/blob/main/.github/workflows/helm-validations.yml#L29C6-L29C6
This file may no longer be required or that existing helm-validations.yml file could be updated if this new kube-linter-action is more up to date than what we are using in our existing workflow.
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.
As you can see here: https://github.com/dell/helm-charts/actions/runs/5999804015/job/16270649466?pr=267, after adding scanning to the whole repo many issues in other charts appeared.
I think that in this PR the cosi chart should be scanned, but other teams should correct their charts. The additional tasks have to be planned.
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.
@tdawe To add my 5 cents, I think there should be (at least) 2 configurations for KubeLinter, as the rules applicable to things like COSI Driver or CS Modules, might not be applicable to CSI Drivers, as CSI Drivers are interacting with K8s Node's filesystem.