Skip to content

Commit

Permalink
fix missing NodeSLO CRD (#15)
Browse files Browse the repository at this point in the history
* fix missing NodeSLO CRD

Signed-off-by: Tao Li <joseph.t.lee@outlook.com>

* fix chart-testing action

Signed-off-by: Tao Li <joseph.t.lee@outlook.com>
  • Loading branch information
eahydra committed Apr 7, 2022
1 parent 159607c commit 848c135
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,24 @@ jobs:

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

- name: List changed charts
- name: Run chart-testing (list-changed)
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "::set-output name=changed_charts::$charts"
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
run: ct lint --debug --target-branch ${{ github.event.repository.default_branch }} --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
if: steps.list-changed.outputs.changed == 'true'
with:
config: .github/configs/kind-config.yaml
- name: Skip HPA tests of ArgoCD
if: contains(steps.list-changed.outputs.changed_charts, 'koordinator')
run: |
## Metrics API not available in kind cluster
rm charts/argo-cd/ci/ha-autoscaling-values.yaml

- name: Run chart-testing (install)
run: ct install --config ./.github/configs/ct-install.yaml
run: ct install --target-branch ${{ github.event.repository.default_branch }} --config ./.github/configs/ct-install.yaml
if: steps.list-changed.outputs.changed == 'true'
70 changes: 70 additions & 0 deletions versions/v0.1.0/templates/slo.koordinator.sh_nodeslos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{{- if .Values.crds.managed }}

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: nodeslos.slo.koordinator.sh
spec:
group: slo.koordinator.sh
names:
kind: NodeSLO
listKind: NodeSLOList
plural: nodeslos
singular: nodeslo
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: NodeSLO is the Schema for the nodeslos API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: NodeSLOSpec defines the desired state of NodeSLO
properties:
resourceUsedThresholdWithBE:
description: BE pods will be limited if node resource usage overload
properties:
cpuSuppressPolicy:
description: CPUSuppressPolicy
type: string
cpuSuppressThresholdPercent:
description: cpu suppress threshold percentage (0,100), default
= 65
format: int64
type: integer
enable:
description: whether the strategy is enabled, default = true
type: boolean
type: object
type: object
status:
description: NodeSLOStatus defines the observed state of NodeSLO
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

0 comments on commit 848c135

Please sign in to comment.