Skip to content

Commit

Permalink
Merge pull request #5 from simplyblock-io/devops
Browse files Browse the repository at this point in the history
update helm charts
  • Loading branch information
boddumanohar authored Feb 16, 2024
2 parents d27879a + 36f6606 commit c732884
Show file tree
Hide file tree
Showing 19 changed files with 335 additions and 74 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master, 'dev', 'release-**' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, 'dev', 'release-**' ]
schedule:
- cron: '0 */24 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.18
id: go

- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
run: |
make all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
20 changes: 20 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on:
push:
branches: ['master', 'dev']
pull_request:

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum
ignore_words_list: "browseable,ro"
36 changes: 0 additions & 36 deletions .github/workflows/go.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Linux Unit tests
on:
pull_request:
push:
branches: ['master', 'dev']


jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Test
run: |
make test
# - name: Sanity test
# env:
# GITHUB_ACTIONS: true
# run: |
# export PATH=$PATH:$HOME/.local/bin
# make
# echo "is running in github actions: $GITHUB_ACTIONS"
# make sanity-test
26 changes: 26 additions & 0 deletions .github/workflows/pluto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: k8s api version check
on:
pull_request:
push:
branches: ['master', 'dev']

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

# https://pluto.docs.fairwinds.com/advanced/#display-options
- name: Download pluto
uses: FairwindsOps/pluto/github-action@master

- name: Check deploy folder
run: |
pluto detect-files -d deploy --ignore-deprecations --ignore-removals
- name: Check kubernetes folder
run: |
pluto detect-files -d deploy/kubernetes
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ image: spdkcsi
clean:
rm -f $(OUT_DIR)/spdkcsi
go clean -testcache

sanity-test: spdkcsi
test/sanity/run-test.sh
4 changes: 2 additions & 2 deletions charts/spdk-csi/templates/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ kind: ConfigMap
metadata:
name: spdkcsi-cm
data:
# rpcURL: spdk json rpc target
# targetType: nvme-rdma, nvme-tcp, iscsi
# uuid: the simplyblock cluster UUID
# ip: the management IP of the simplyblock cluster
# targetAddr: target service IP
config.json: |-
{{ toJson .Values.csiConfig | indent 4 -}}
Expand Down
8 changes: 7 additions & 1 deletion charts/spdk-csi/templates/controller-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ rules:
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list"]
verbs: ["create", "get", "list", "watch", "update", "delete"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
Expand Down
16 changes: 15 additions & 1 deletion charts/spdk-csi/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
{{ include "spdk.labels" . | indent 6 }}
app: spdkcsi-controller
spec:
serviceAccount: spdkcsi-controller-sa
serviceAccountName: spdkcsi-controller-sa
hostNetwork: true
containers:
- name: spdkcsi-provisioner
Expand All @@ -31,6 +31,20 @@ spec:
- "--timeout=30s"
- "--retry-interval-start=500ms"
- "--leader-election=false"
- "--feature-gates=Topology=true"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: spdkcsi-snapshotter
image: "{{ .Values.image.csiSnapshotter.repository }}:{{ .Values.image.csiSnapshotter.tag }}"
args:
- "--csi-address=unix:///csi/csi-provisioner.sock"
- "--v=5"
- "--timeout=150s"
- "--leader-election=false"
imagePullPolicy: {{ .Values.image.csiProvisioner.pullPolicy }}
securityContext:
privileged: true
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand Down
20 changes: 16 additions & 4 deletions charts/spdk-csi/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
{{ include "spdk.labels" . | indent 6 }}
app: spdkcsi-node
spec:
serviceAccount: spdkcsi-node-sa
serviceAccountName: spdkcsi-node-sa
hostNetwork: true
containers:
- name: spdkcsi-registrar
Expand All @@ -38,7 +38,7 @@ spec:
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
add: ["SYS_ADMIN", "SYS_MODULE"]
allowPrivilegeEscalation: true
image: "{{ .Values.image.spdkcsi.repository }}:{{ .Values.image.spdkcsi.tag }}"
imagePullPolicy: {{ .Values.image.spdkcsi.pullPolicy }}
Expand All @@ -55,8 +55,7 @@ spec:
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c",
"/usr/sbin/iscsid || echo failed to start iscsid"]
command: ["/bin/sh", "-c", "sudo modprobe nvme-tcp || echo failed to modprobe nvme-tcp"]
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand All @@ -73,6 +72,12 @@ spec:
- name: spdkcsi-nodeserver-config
mountPath: /etc/spdkcsi-nodeserver-config/
readOnly: true
- name: spdkcsi-config
mountPath: /etc/spdkcsi-config/
readOnly: true
- name: spdkcsi-secret
mountPath: /etc/spdkcsi-secret/
readOnly: true
volumes:
- name: socket-dir
hostPath:
Expand All @@ -99,3 +104,10 @@ spec:
- name: spdkcsi-nodeserver-config
configMap:
name: spdkcsi-nodeservercm
optional: true
- name: spdkcsi-config
configMap:
name: spdkcsi-cm
- name: spdkcsi-secret
secret:
secretName: spdkcsi-secret
12 changes: 11 additions & 1 deletion charts/spdk-csi/templates/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ metadata:
name: spdkcsi-sc
provisioner: csi.spdk.io
parameters:
fsType: ext4
csi.storage.k8s.io/fstype: ext4
pool_name: testing1
qos_rw_iops: "0"
qos_rw_mbytes: "0"
qos_r_mbytes: "0"
qos_w_mbytes: "0"
compression: "False"
encryption: "False"
distr-ndcs: "1"
distr-npcs: "1"
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
{{- end -}}
46 changes: 22 additions & 24 deletions charts/spdk-csi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@
---
image:
spdkcsi:
repository: spdkcsi/spdkcsi
tag: canary
pullPolicy: Never
repository: manoharbrm/spdkcsi
tag: latest
pullPolicy: Always
csiProvisioner:
repository: k8s.gcr.io/sig-storage/csi-provisioner
tag: v2.0.2
pullPolicy: IfNotPresent
repository: registry.k8s.io/sig-storage/csi-provisioner
tag: v3.5.0
pullPolicy: Always
csiAttacher:
repository: k8s.gcr.io/sig-storage/csi-attacher
tag: v3.0.0
pullPolicy: IfNotPresent
repository: gcr.io/k8s-staging-sig-storage/csi-attacher
tag: v3.5.0
pullPolicy: Always
nodeDriverRegistrar:
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
tag: v2.0.1
pullPolicy: IfNotPresent
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
tag: v2.8.0
pullPolicy: Always
csiSnapshotter:
repository: registry.k8s.io/sig-storage/csi-snapshotter
tag: v6.2.2
pullPolicy: Always

serviceAccount:
# Specifies whether a serviceAccount should be created
Expand All @@ -38,30 +42,24 @@ externallyManagedSecret:

spdkdev:
# Specifies whether a spdkdev should be created
create: true
create: false

storageclass:
# Specifies whether a spdkdev should be created
create: true

controller:
replicas: 1

# Configuration for the CSI to connect to the cluster
csiConfig:
nodes:
- name: &name localhost
rpcURL: 'http://127.0.0.1:9009'
targetType: nvme-tcp
targetAddr: 127.0.0.1
simplybk:
uuid: 963c9d0a-4506-43c3-a722-0b7c8b157038
ip: 13.58.2.30

# Configuration for the csiSecret
csiSecret:
rpcTokens:
# The "name" matches "csiConfig.node.name"
- name: *name
username: spdkcsiuser
password: spdkcsipass
simplybk:
secret: 2BAbQTPEDi4o73VHymg2

spdkdevCreateCommonds:
/root/spdk/app/spdk_tgt/spdk_tgt > /tmp/spdk-tgt.log 2>&1 &
Expand Down
Loading

0 comments on commit c732884

Please sign in to comment.