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

69 integration with proxmox paas proxmox bundle #107

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1675469
add new bandle and start integrate proxmox-csi-node
themoriarti Apr 12, 2024
fb465c9
add deploy for proxmox-csi-node
themoriarti Apr 17, 2024
3750d99
Add proxmox-csi plugin
kvaps Apr 30, 2024
9df8bf2
Merge pull request #112 from aenix-io/proxmox-csi
themoriarti Apr 30, 2024
61a5d18
Sync etcd-operator changes to proxmox integration (#114)
themoriarti May 2, 2024
23932d4
Merge branch 'main' into 69-integration-with-proxmox-paas-proxmox-bundle
themoriarti May 13, 2024
ffb7bb5
Add Managed Kubernetes - Proxmox version
remipcomaite May 13, 2024
7d63810
Merge pull request #132 from remipcomaite/69-integration-with-proxmox…
themoriarti May 14, 2024
84c8c25
Sync 0.6.0 to integration (#136)
themoriarti May 18, 2024
75cb6c0
add kubernetes-proxmox version
May 18, 2024
1b64624
add kubernetes-proxmox version
themoriarti May 18, 2024
2f59488
add dev version for proxmox integration
themoriarti May 22, 2024
46a9dfb
Merge branch '69-integration-with-proxmox-paas-proxmox-bundle' of htt…
May 22, 2024
4ed51ca
testing version 0.6.0-fix1
themoriarti May 23, 2024
e475cb2
fix MR conflicts
themoriarti May 23, 2024
f157ccf
fix MR conflicts
themoriarti May 23, 2024
df168e8
Sync main to integration (#146)
themoriarti May 23, 2024
c5dd46c
pre-build version
themoriarti May 23, 2024
c85e4ed
add kubemox and fix bundle paas-proxmox
themoriarti May 25, 2024
b215325
many fixes
themoriarti May 30, 2024
a757a11
Merge branch '69-integration-with-proxmox-paas-proxmox-bundle' of htt…
Jun 14, 2024
74e2f4a
Merge branch 'main' into 69-integration-with-proxmox-paas-proxmox-bundle
themoriarti Jun 21, 2024
d5c202b
fix conflict in ubuntu-container-disk.tag
themoriarti Jul 17, 2024
bb2918d
Sync 0.9 to proxmox integration (#221)
themoriarti Jul 17, 2024
85feafc
71 configure GitHub ci (#113)
themoriarti Jul 19, 2024
931d718
Merge branch 'main' into 69-integration-with-proxmox-paas-proxmox-bundle
themoriarti Jul 19, 2024
0222e41
Sync 0.10.1 to proxmox integration (#242)
themoriarti Jul 30, 2024
df53e06
Merge branch '69-integration-with-proxmox-paas-proxmox-bundle' of htt…
Aug 8, 2024
51602ee
remove kubernetes-proxmox, kubemox, add to capi-providers proxmox
Aug 8, 2024
ec150c8
resolve conflicts
themoriarti Aug 8, 2024
c3737e9
resolve conflicts
themoriarti Aug 8, 2024
7e9b380
resolve conflicts
themoriarti Aug 8, 2024
a7029d6
Sync main to integration
themoriarti Aug 8, 2024
ff9b291
resolve conflicts
themoriarti Aug 8, 2024
46121ce
Merge pull request #270 from aenix-io/main
themoriarti Aug 8, 2024
4939b9b
Sync main to proxmox intergation
themoriarti Sep 15, 2024
33b53de
Fix versions_map
themoriarti Sep 15, 2024
2df5b1b
Merge pull request #343 from aenix-io/main
themoriarti Sep 15, 2024
b3a9ed7
Add infrastructure provider proxmox
themoriarti Sep 15, 2024
7436a15
enable/disable capi-providers
themoriarti Sep 25, 2024
4b65402
Merge branch 'main' into 69-integration-with-proxmox-paas-proxmox-bundle
themoriarti Sep 25, 2024
18d91e2
Merge branch 'main' into 69-integration-with-proxmox-paas-proxmox-bundle
themoriarti Oct 9, 2024
c75b97f
Update providers.yaml
themoriarti Oct 9, 2024
f76bc8d
Merge pull request #483 from aenix-io/main
themoriarti Nov 22, 2024
7258c56
Upgrade proxmox-CCM to 0.5.1 and proxmox-csi-plugin to 0.8.2
themoriarti Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: CI/CD Workflow

on:
push:
branches:
- main
paths:
- '**.yaml'
- '**/Dockerfile'
- '**/charts/**'
tags:
- 'v*'

env:
IMAGE_NGINX_CACHE: nginx-cache
REGISTRY: ghcr.io/${{ github.repository_owner }}
PUSH: 1
LOAD: 1
NGINX_CACHE_TAG: v0.1.0
TAG: v0.3.1
PLATFORM_ARCH: linux/amd64

jobs:
build-and-push:
name: Build Cozystack
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Set up Docker Registry
run: |
if [ "$GITHUB_ACTIONS" = "true" ]; then
echo "REGISTRY=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV
else
echo "REGISTRY=localhost:5000/cozystack_local" >> $GITHUB_ENV
fi
Comment on lines +34 to +40
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix quoting in the "Set up Docker Registry" step.

To address potential issues with word splitting and to improve script safety, please add double quotes around the variable expansions:

  - name: Set up Docker Registry
    run: |
      if [ "$GITHUB_ACTIONS" = "true" ]; then
-       echo "REGISTRY=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV
+       echo "REGISTRY=ghcr.io/${{ github.repository_owner }}" >> "$GITHUB_ENV"
      else
-       echo "REGISTRY=localhost:5000/cozystack_local" >> $GITHUB_ENV
+       echo "REGISTRY=localhost:5000/cozystack_local" >> "$GITHUB_ENV"
      fi

These changes will prevent potential issues with word splitting and improve overall script safety.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Set up Docker Registry
run: |
if [ "$GITHUB_ACTIONS" = "true" ]; then
echo "REGISTRY=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV
else
echo "REGISTRY=localhost:5000/cozystack_local" >> $GITHUB_ENV
fi
- name: Set up Docker Registry
run: |
if [ "$GITHUB_ACTIONS" = "true" ]; then
echo "REGISTRY=ghcr.io/${{ github.repository_owner }}" >> "$GITHUB_ENV"
else
echo "REGISTRY=localhost:5000/cozystack_local" >> "$GITHUB_ENV"
fi
🧰 Tools
🪛 actionlint

35-35: shellcheck reported issue in this script: SC2086:info:2:61: Double quote to prevent globbing and word splitting

(shellcheck)


35-35: shellcheck reported issue in this script: SC2086:info:4:53: Double quote to prevent globbing and word splitting

(shellcheck)


- uses: actions/checkout@v3
- name: Build usig make
run: |
make

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
48 changes: 48 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint

on:
push:
branches: [ main ] # Lint only on pushes to the main branch
pull_request:
branches: [ main ] # Lint on PRs targeting the main branch

permissions:
contents: read

jobs:
lint:
name: Super-Linter
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run Super-Linter
uses: github/super-linter@v4
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicated GITHUB_TOKEN definition.

The GITHUB_TOKEN environment variable is defined twice (lines 27 and 31). This duplication is unnecessary and may cause confusion.

Remove the duplicate definition:

 env:
   # To report GitHub Actions status checks
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   VALIDATE_ALL_CODEBASE: false  # Lint only changed files
   VALIDATE_TERRAFORM: false     # Disable Terraform linting (remove if you need it)
   DEFAULT_BRANCH: main          # Set your default branch
-  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   # Enable only the linters you need for your project
   VALIDATE_JAVASCRIPT_ES: true

Also applies to: 31-31

VALIDATE_ALL_CODEBASE: false # Lint only changed files
VALIDATE_TERRAFORM: false # Disable Terraform linting (remove if you need it)
DEFAULT_BRANCH: main # Set your default branch
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Enable only the linters you need for your project
VALIDATE_JAVASCRIPT_ES: true
VALIDATE_PYTHON_BLACK: true
VALIDATE_HTML: false
VALIDATE_GO: false
VALIDATE_XML: false
VALIDATE_JAVA: false
VALIDATE_DOCKERFILE: false
# turn off JSCPD copy/paste detection, which results in lots of results for examples and devops repos
VALIDATE_JSCPD: false
# turn off shfmt shell formatter as we already have shellcheck
VALIDATE_SHELL_SHFMT: false
VALIDATE_EDITORCONFIG: false
# prevent Kubernetes CRD API's from causing kubeval to fail
# also change schema location to an up-to-date list
# https://github.com/yannh/kubernetes-json-schema/#kubeval
KUBERNETES_KUBEVAL_OPTIONS: --ignore-missing-schemas --schema-location https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/
7 changes: 7 additions & 0 deletions .github/workflows/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# MD013/line-length - Line length
MD013:
# Number of characters, default is 80
line_length: 9999
# check code blocks?
code_blocks: false
55 changes: 55 additions & 0 deletions .github/workflows/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'

rules:
braces:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 1
max-spaces-inside-empty: 5
brackets:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 1
max-spaces-inside-empty: 5
colons:
level: warning
max-spaces-before: 0
max-spaces-after: 1
commas:
level: warning
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments: disable
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines:
level: warning
max: 2
max-start: 0
max-end: 0
hyphens:
level: warning
max-spaces-after: 1
indentation:
level: warning
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
Comment on lines +47 to +51
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove redundant line length rule and consider enabling formatting rules

There's a redundant line-length: disable rule here, as it's redefined later in the file. This should be removed to avoid confusion.

Also, consider enabling the new-line-at-end-of-file and trailing-spaces rules. These help maintain consistent formatting across the project.

Apply this diff to remove the redundant rule:

-  line-length: disable
   new-line-at-end-of-file: disable
   new-lines:
     type: unix
   trailing-spaces: disable

Consider enabling new-line-at-end-of-file and trailing-spaces rules for better consistency.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable

line-length:
max: 130
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
Comment on lines +52 to +55
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

LGTM for line length rule, but address duplication

The line length rule is well-defined with a reasonable 130-character limit. However, this rule is flagged as a duplication by yamllint due to the earlier line-length: disable entry.

To resolve this, ensure you've removed the earlier line-length: disable entry as suggested in the previous comment. This will eliminate the duplication and keep the well-defined rule.

🧰 Tools
🪛 yamllint

[error] 52-52: duplication of key "line-length" in mapping

(key-duplicates)

2 changes: 1 addition & 1 deletion packages/apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repo:
rm -rf "$(TMP)"

fix-chartnames:
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: fix-chartnames target is no longer modifying files

The removal of the -i flag from the sed command means that Chart.yaml files are no longer being updated in-place. This breaks the functionality of the fix-chartnames target and may lead to inconsistencies in chart names and versions.

To fix this issue, reintroduce the -i flag to the sed command. Apply the following change:

-	find . -maxdepth 2 -name Chart.yaml  | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
+	find . -maxdepth 2 -name Chart.yaml  | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done

This change will ensure that the Chart.yaml files are correctly updated in-place, maintaining the intended functionality of the fix-chartnames target.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done


gen-versions-map: fix-chartnames
../../hack/gen_versions_map.sh
Expand Down
54 changes: 54 additions & 0 deletions packages/apps/ferretdb/ferretdb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions packages/core/platform/bundles/paas-proxmox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{{- $cozyConfig := lookup "v1" "ConfigMap" "cozy-system" "cozystack" }}

releases:
- name: cilium
releaseName: cilium
chart: cozy-cilium
namespace: cozy-cilium
privileged: true
dependsOn: []

- name: kubeovn
releaseName: kubeovn
chart: cozy-kubeovn
namespace: cozy-kubeovn
privileged: true
dependsOn: [cilium]
values:
cozystack:
nodesHash: {{ include "cozystack.master-node-ips" . | sha256sum }}
kube-ovn:
ipv4:
POD_CIDR: "{{ index $cozyConfig.data "ipv4-pod-cidr" }}"
POD_GATEWAY: "{{ index $cozyConfig.data "ipv4-pod-gateway" }}"
SVC_CIDR: "{{ index $cozyConfig.data "ipv4-svc-cidr" }}"
JOIN_CIDR: "{{ index $cozyConfig.data "ipv4-join-cidr" }}"

- name: cert-manager
releaseName: cert-manager
chart: cozy-cert-manager
namespace: cozy-cert-manager
dependsOn: [cilium,kubeovn]

- name: cert-manager-issuers
releaseName: cert-manager-issuers
chart: cozy-cert-manager-issuers
namespace: cozy-cert-manager
dependsOn: [cilium,kubeovn,cert-manager]

- name: victoria-metrics-operator
releaseName: victoria-metrics-operator
chart: cozy-victoria-metrics-operator
namespace: cozy-victoria-metrics-operator
dependsOn: [cilium,kubeovn,cert-manager]

- name: monitoring
releaseName: monitoring
chart: cozy-monitoring
namespace: cozy-monitoring
privileged: true
dependsOn: [cilium,kubeovn,victoria-metrics-operator]

- name: grafana-operator
releaseName: grafana-operator
chart: cozy-grafana-operator
namespace: cozy-grafana-operator
dependsOn: [cilium,kubeovn]

- name: mariadb-operator
releaseName: mariadb-operator
chart: cozy-mariadb-operator
namespace: cozy-mariadb-operator
dependsOn: [cilium,kubeovn,cert-manager,victoria-metrics-operator]

- name: postgres-operator
releaseName: postgres-operator
chart: cozy-postgres-operator
namespace: cozy-postgres-operator
dependsOn: [cilium,kubeovn,cert-manager]

- name: rabbitmq-operator
releaseName: rabbitmq-operator
chart: cozy-rabbitmq-operator
namespace: cozy-rabbitmq-operator
dependsOn: [cilium,kubeovn]

- name: redis-operator
releaseName: redis-operator
chart: cozy-redis-operator
namespace: cozy-redis-operator
dependsOn: [cilium,kubeovn]

- name: proxmox-csi-operator
releaseName: proxmox-csi-operator
chart: cozy-proxmox-csi-operator
namespace: cozy-proxmox
dependsOn: [cilium,kubeovn,cert-manager]

- name: proxmox-csi-operator
releaseName: proxmox-csi-operator
chart: cozy-proxmox-csi-operator
namespace: cozy-proxmox
dependsOn: [cilium,kubeovn,cert-manager]
Comment on lines +82 to +92
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate proxmox-csi-operator release.

The proxmox-csi-operator release is defined twice with identical configuration. This is likely an error and could lead to deployment issues.

Remove one of the duplicate blocks, keeping only one instance of the proxmox-csi-operator release.

🧰 Tools
🪛 yamllint

[warning] 86-86: too few spaces after comma

(commas)


[warning] 86-86: too few spaces after comma

(commas)


[warning] 92-92: too few spaces after comma

(commas)


[warning] 92-92: too few spaces after comma

(commas)


- name: telepresence
releaseName: traffic-manager
chart: cozy-telepresence
namespace: cozy-telepresence
dependsOn: [cilium,kubeovn]

- name: dashboard
releaseName: dashboard
chart: cozy-dashboard
namespace: cozy-dashboard
dependsOn: [cilium,kubeovn]
{{- if .Capabilities.APIVersions.Has "source.toolkit.fluxcd.io/v1beta2" }}
{{- with (lookup "source.toolkit.fluxcd.io/v1beta2" "HelmRepository" "cozy-public" "").items }}
values:
kubeapps:
redis:
master:
podAnnotations:
{{- range $index, $repo := . }}
{{- with (($repo.status).artifact).revision }}
repository.cozystack.io/{{ $repo.metadata.name }}: {{ quote . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

- name: kamaji
releaseName: kamaji
chart: cozy-kamaji
namespace: cozy-kamaji
dependsOn: [cilium,kubeovn,cert-manager]

- name: capi-operator
releaseName: capi-operator
chart: cozy-capi-operator
namespace: cozy-cluster-api
privileged: true
dependsOn: [cilium,kubeovn,cert-manager]

- name: capi-providers
releaseName: capi-providers
chart: cozy-capi-providers
namespace: cozy-cluster-api
privileged: true
dependsOn: [cilium,kubeovn,capi-operator]
2 changes: 1 addition & 1 deletion packages/extra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repo:
rm -rf "$(TMP)"

fix-chartnames:
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the sed command to modify files in-place

The removal of the -i option from the sed command changes its behavior. Instead of modifying the Chart.yaml files in-place, it now outputs the modified content to stdout without changing the files. This breaks the functionality of the fix-chartnames target and may affect dependent targets like gen-versions-map and check-version-map.

To fix this issue, reintroduce the -i option to the sed command:

-	find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
+	find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done

This change will ensure that the Chart.yaml files are modified as intended, maintaining the correct functionality of the fix-chartnames target and its dependent targets.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done
find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $$2}' | while read i; do sed -i "s/^name: .*/name: $$i/" "$$i/Chart.yaml"; done


gen-versions-map: fix-chartnames
../../hack/gen_versions_map.sh
Expand Down
2 changes: 1 addition & 1 deletion packages/extra/etcd/templates/datastore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ metadata:
name: etcd-client-tls
annotations:
helm.sh/hook: pre-install
helm.sh/resource-policy: keep
helm.sh/resource-policy: keep
Loading
Loading