Skip to content

Commit

Permalink
Merge pull request #10 from KusionStack/231113-ctlrmesh-0.1.1
Browse files Browse the repository at this point in the history
init ctrlmesh 0.1.1
  • Loading branch information
Eikykun authored Nov 16, 2023
2 parents f9ade51 + 21aaff9 commit 3fdc359
Show file tree
Hide file tree
Showing 48 changed files with 2,523 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint-anf-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'
check-latest: true

- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.0

- name: List changed charts
id: list-changed
Expand All @@ -34,6 +35,7 @@ jobs:
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "::set-output name=changed_charts::$charts"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
Expand Down
26 changes: 13 additions & 13 deletions versions/ctrlmesh/0.1.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ init:
tag: v0.1.0

shardingGroupVersionKinds:
groupVersionKinds:
ctrlmesh.kusionstack.io/v1alpha1:
- '*'
v1:
- Pod
- PersistentVolumeClaim
- Service
- ConfigMap
- Endpoint
apps/v1:
- StatefulSet
- ReplicaSet
- ControllerRevision
groupVersionKinds:
ctrlmesh.kusionstack.io/v1alpha1:
- '*'
v1:
- Pod
- PersistentVolumeClaim
- Service
- ConfigMap
- Endpoint
apps/v1:
- StatefulSet
- ReplicaSet
- ControllerRevision


16 changes: 16 additions & 0 deletions versions/ctrlmesh/0.1.1/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
name: ctrlmesh
description: Helm chart for Controller-Mesh components
# 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.1
# 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: 0.1.1

home: https://KusionStack.io
sources:
- https://github.com/KusionStack/controllermesh
Empty file.
1 change: 1 addition & 0 deletions versions/ctrlmesh/0.1.1/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome! ^_^
62 changes: 62 additions & 0 deletions versions/ctrlmesh/0.1.1/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "myctrlmesh.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 "myctrlmesh.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 "myctrlmesh.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "myctrlmesh.labels" -}}
helm.sh/chart: {{ include "myctrlmesh.chart" . }}
{{ include "myctrlmesh.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "myctrlmesh.selectorLabels" -}}
app.kubernetes.io/name: {{ include "myctrlmesh.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "myctrlmesh.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "myctrlmesh.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions versions/ctrlmesh/0.1.1/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
data:
resource-config: |
{{- toYaml .Values.shardingGroupVersionKinds | nindent 4 }}
kind: ConfigMap
metadata:
name: ctrlmesh-sharding-resource
namespace: {{ .Values.namespace }}
Loading

0 comments on commit 3fdc359

Please sign in to comment.