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

Commit

Permalink
Add automated basic test, bump autoscaler to v2beta2 (#24)
Browse files Browse the repository at this point in the history
* Adapt README to new Helm install syntax
* Add basic tests to check deployment is ok
* Add GHA badge
* Deprecate autoscaling/v2beta1
* Bump chart version
  • Loading branch information
banzo authored Feb 15, 2023
1 parent 89fc031 commit 98574da
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/basic_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
example:
name: Minikube installation - Basic test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.28.0'
kubernetes version: 'v1.25.4'
github token: ${{ secrets.GITHUB_TOKEN }}
#- run: minikube addons list
#- name: Interact with the cluster
# run: kubectl get nodes
- name: Checkout code
uses: actions/checkout@v3
- name: Install Swagger-ui
run: helm install swagger-ui .
- name: Check deployment status
run: |
kubectl rollout status --watch deployment/swagger-ui-swaggerui --timeout=5m
# this test would be nice but it does not work in its current state
#- name: Check web application responds
# run: |
# 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) | \
# grep 'Swagger UI'
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: swaggerui
version: 0.3.5
version: 0.3.6
appVersion: 3.24.3
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.
keywords:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Helm Chart for swagger-ui

[![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)
![test](https://github.com/cetic/helm-swagger-ui/actions/workflows/basic_test.yml/badge.svg)

## Introduction

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

```bash
helm install --name my-release cetic/swaggerui
helm install my-release cetic/swaggerui
```

## Uninstallation

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

```bash
helm delete --purge my-release
helm delete my-release
```

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

## License

[Apache License 2.0](/LICENSE.md)
[Apache License 2.0](/LICENSE.md)
10 changes: 7 additions & 3 deletions templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "swagger-ui.fullname" . }}
Expand All @@ -20,12 +20,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

0 comments on commit 98574da

Please sign in to comment.