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

project structure #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .github/lint_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
remote: origin
target-branch: main
check-version-increment: false
chart-dirs:
- apps/dev
- apps/stage
- apps/prod
18 changes: 18 additions & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Codespell

on: pull_request

jobs:
codespell:
name: Codespell
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Codespell
uses: codespell-project/actions-codespell@master
with:
ignore_words_list: aks
check_filenames: true
check_hidden: false
skip: ./.git,*-secret.yaml,codespell.yaml
116 changes: 116 additions & 0 deletions .github/workflows/kustomized-helm-diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Kustomized-Helm manifest diff

on:
pull_request:

jobs:
list-changed-charts:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
changed_charts: ${{ steps.list-changed.outputs.charts }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: azure/setup-helm@v3
with:
version: v3.12.1

- uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true

- uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed_files=$(ct list-changed --config .github/lint_config.yaml | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "Changed files: $changed_files"
echo "charts=${changed_files}" >> "$GITHUB_OUTPUT"
dynamic_matrix:
needs: list-changed-charts
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
file: ${{ fromJson(needs.list-changed-charts.outputs.changed_charts) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: head

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
path: main

- uses: azure/setup-helm@v3
with:
version: v3.12.1

- name: Helm dependency update and render
run: |
REF_PATH=head
if [ ! -d "${REF_PATH}/${{ matrix.file }}" ]; then
mkdir -p "${REF_PATH}/${{ matrix.file }}"
touch "${REF_PATH}/${{ matrix.file }}/all.yaml"
touch "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "apiVersion: kustomize.config.k8s.io/v1beta1" > "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "kind: Kustomization" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "resources:" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo " - all.yaml" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
else
pushd ${REF_PATH}/${{ matrix.file }}
helm dependency update
helm template . --name-template $(basename $PWD) --namespace frinx --values values.yaml --values cluster-values.yaml --include-crds > all.yaml
popd
fi
- name: Helm dependency update and render
run: |
REF_PATH=main
if [ ! -d "${REF_PATH}/${{ matrix.file }}" ]; then
mkdir -p "${REF_PATH}/${{ matrix.file }}"
touch "${REF_PATH}/${{ matrix.file }}/all.yaml"
touch "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "apiVersion: kustomize.config.k8s.io/v1beta1" > "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "kind: Kustomization" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo "resources:" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
echo " - all.yaml" >> "${REF_PATH}/${{ matrix.file }}/kustomization.yaml"
else
pushd ${REF_PATH}/${{ matrix.file }}
helm dependency update
helm template . --name-template $(basename $PWD) --namespace frinx --values values.yaml --values cluster-values.yaml --include-crds > all.yaml
popd
fi
- uses: int128/kustomize-action@v1
id: kustomize-head
with:
base-directory: head/${{ matrix.file }}
kustomization: kustomization.yaml
write-individual-files: true

- uses: int128/kustomize-action@v1
id: kustomize-base
with:
base-directory: main/${{ matrix.file }}
kustomization: kustomization.yaml
write-individual-files: true

- uses: int128/diff-action@v1
with:
base: ${{ steps.kustomize-base.outputs.directory }}
head: ${{ steps.kustomize-head.outputs.directory }}
22 changes: 22 additions & 0 deletions .github/workflows/kustomized-helm-kube-score.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Kustomized-Helm manifest diff

on:
pull_request:

env:
KUBE_SCORE_VERSION: 1.18.0

jobs:

kube-score:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: install kube-scre
run: |
wget https://github.com/zegl/kube-score/releases/download/v${{ env.KUBE_SCORE_VERSION}}/kube-score_${{ env.KUBE_SCORE_VERSION}}_linux_amd64 -O /usr/local/bin/kube-score
chmod +x /usr/local/bin/kube-score
- run: kube-score version
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.tgz
*.lock
**/temp/*
.idea
66 changes: 66 additions & 0 deletions apps/dev/argocd-appset-frinx-machine-persistence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: frinx-machine-persistence-dev
namespace: argocd
# finalizers:
# - resources-finalizer.argocd.argoproj.io
labels:
deployment: fm-dev
type: frinx-machine-persistence
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
# - matrix:
# generators:
# - list:
# elements:
# - cluster: in-cluster
# namespace: fm-dev
# project: default
- list:
elements:
- name: frinx-arango-config
- name: kafka
- name: postgresql
- name: timescale-db
- name: uniconfig-postgres
template:
metadata:
name: "{{name}}-dev"
labels:
name: "{{name}}"
type: frinx-machine-persistence
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: "default"
destination:
name: "in-cluster"
namespace: "fm-dev"

syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m

source:
repoURL: [email protected]:FRINXio/gitops-boilerplate.git
targetRevision: HEAD
path: "apps/dev/frinx-machine-persistence/{{name}}"
plugin:
name: kustomized-helm
parameters:
- name: helm-template-extra-args
string: |
-f values.yaml -f cluster-values.yaml
24 changes: 24 additions & 0 deletions apps/dev/frinx-machine-monitoring/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

12 changes: 12 additions & 0 deletions apps/dev/frinx-machine-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: frinx-machine-monitoring
description: Kubernetes deployment of FRINX-machine
icon: https://avatars.githubusercontent.com/u/23452093?s=200&v=4
type: application
version: 6.1.0
maintainers:
- name: FRINX
dependencies:
- name: frinx-machine
repository: https://FRINXio.github.io/helm-charts
version: 10.0.0
Empty file.
5 changes: 5 additions & 0 deletions apps/dev/frinx-machine-monitoring/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- all.yaml
19 changes: 19 additions & 0 deletions apps/dev/frinx-machine-monitoring/local-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
environment:
cluster:
enabled: false
local:
enabled: true

# TODO
frinx-machine:
frinx-machine-monitoring:
kube-prometheus-stack:
grafana:
ingress:
enabled: true
ingressClassName: nginx
# Values can be templated
path: /
pathType: Prefix
hosts:
- grafana.127.0.0.1.nip.io
1 change: 1 addition & 0 deletions apps/dev/frinx-machine-monitoring/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 26 additions & 0 deletions apps/dev/frinx-machine-monitoring/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Global settings
global:
dbPersistence:
enabled: false

# Environment selection
# This is used for controlling of obejct deployment from this chart
environment:
cluster:
enabled: false
local:
enabled: false

# Helm Chart dependency installation
tags:
operators: false
monitoring: false
database: false
backend: false


# frinx-machine:
# frinx-machine-monitoring:
# # -- Promtail configurations
# promtail:

24 changes: 24 additions & 0 deletions apps/dev/frinx-machine-operators/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

12 changes: 12 additions & 0 deletions apps/dev/frinx-machine-operators/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: frinx-machine-operators
description: Kubernetes deployment of FRINX-machine
icon: https://avatars.githubusercontent.com/u/23452093?s=200&v=4
type: application
version: 6.1.0
maintainers:
- name: FRINX
dependencies:
- name: frinx-machine
repository: https://FRINXio.github.io/helm-charts
version: 10.0.0
5 changes: 5 additions & 0 deletions apps/dev/frinx-machine-operators/cluster-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
environment:
cluster:
enabled: true
local:
enabled: false
5 changes: 5 additions & 0 deletions apps/dev/frinx-machine-operators/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- all.yaml
5 changes: 5 additions & 0 deletions apps/dev/frinx-machine-operators/local-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
environment:
cluster:
enabled: false
local:
enabled: true
Loading