Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 98574da

Browse files
authored
Add automated basic test, bump autoscaler to v2beta2 (#24)
* Adapt README to new Helm install syntax * Add basic tests to check deployment is ok * Add GHA badge * Deprecate autoscaling/v2beta1 * Bump chart version
1 parent 89fc031 commit 98574da

File tree

4 files changed

+51
-7
lines changed

4 files changed

+51
-7
lines changed

.github/workflows/basic_test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
example:
13+
name: Minikube installation - Basic test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: Setup Minikube
19+
uses: manusa/actions-setup-minikube@v2.7.2
20+
with:
21+
minikube version: 'v1.28.0'
22+
kubernetes version: 'v1.25.4'
23+
github token: ${{ secrets.GITHUB_TOKEN }}
24+
#- run: minikube addons list
25+
#- name: Interact with the cluster
26+
# run: kubectl get nodes
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
- name: Install Swagger-ui
30+
run: helm install swagger-ui .
31+
- name: Check deployment status
32+
run: |
33+
kubectl rollout status --watch deployment/swagger-ui-swaggerui --timeout=5m
34+
35+
# this test would be nice but it does not work in its current state
36+
#- name: Check web application responds
37+
# run: |
38+
# curl -sk http://$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}"):$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services swagger-ui-swaggerui) | \
39+
# grep 'Swagger UI'

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
apiVersion: v2
33
name: swaggerui
4-
version: 0.3.5
4+
version: 0.3.6
55
appVersion: 3.24.3
66
description: Swagger is an open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful Web services.
77
keywords:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Helm Chart for swagger-ui
22

33
[![CircleCI](https://circleci.com/gh/cetic/helm-swagger-ui.svg?style=svg)](https://circleci.com/gh/cetic/helm-swagger-ui/tree/master) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![version](https://img.shields.io/github/tag/cetic/helm-swagger-ui.svg?label=release)
4+
![test](https://github.com/cetic/helm-swagger-ui/actions/workflows/basic_test.yml/badge.svg)
45

56
## Introduction
67

@@ -37,15 +38,15 @@ The following items can be set via `--set` flag during installation or configure
3738
Install the swagger-ui helm chart with a release name `my-release`:
3839

3940
```bash
40-
helm install --name my-release cetic/swaggerui
41+
helm install my-release cetic/swaggerui
4142
```
4243

4344
## Uninstallation
4445

4546
To uninstall/delete the `my-release` deployment:
4647

4748
```bash
48-
helm delete --purge my-release
49+
helm delete my-release
4950
```
5051

5152
## Configuration
@@ -101,4 +102,4 @@ Please read the official [Contribution Guide](https://github.com/helm/charts/blo
101102

102103
## License
103104

104-
[Apache License 2.0](/LICENSE.md)
105+
[Apache License 2.0](/LICENSE.md)

templates/hpa.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.autoscaling.enabled }}
2-
apiVersion: autoscaling/v2beta1
2+
apiVersion: autoscaling/v2beta2
33
kind: HorizontalPodAutoscaler
44
metadata:
55
name: {{ include "swagger-ui.fullname" . }}
@@ -20,12 +20,16 @@ spec:
2020
- type: Resource
2121
resource:
2222
name: cpu
23-
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
target:
24+
type: Utilization
25+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
2426
{{- end }}
2527
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
2628
- type: Resource
2729
resource:
2830
name: memory
29-
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31+
target:
32+
type: Utilization
33+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
3034
{{- end }}
3135
{{- end }}

0 commit comments

Comments
 (0)