Skip to content

Commit

Permalink
Helm 3 (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: JJ Asghar <[email protected]>
  • Loading branch information
LeoColomb and jjasghar authored Jun 5, 2020
1 parent 7146bd1 commit 0fb1d3d
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 33 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
container: quay.io/helmpack/chart-testing:v2.4.0
steps:
- uses: actions/checkout@v1
- name: Lint
run: ct lint --config config.yaml
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Run chart-testing (lint)
id: lint
uses: helm/[email protected]
with:
command: lint
config: config.yaml
# - name: Create kind cluster
# uses: helm/[email protected]
# # Only build a kind cluster if there are chart changes to test.
# if: steps.lint.outputs.changed == 'true'
# - name: Run chart-testing (install)
# uses: helm/[email protected]
# with:
# command: install
# config: config.yaml

release:
name: Release
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## Getting Started

1. **Install Helm**
Get the latest [Helm release](https://github.com/kubernetes/helm#install).
Get the latest [Helm release](https://helm.sh/docs/intro/install/).

2. **Add YOURLS Helm Chart repository**
```console
Expand All @@ -18,8 +18,8 @@

3. **Install a chart**
See docs on your preferred sources:
* [Charts docs on Helm Hub](https://hub.helm.sh/charts/yourls).
* [Charts respective READMEs](charts).
* [Charts docs on Helm Hub](https://hub.helm.sh/charts/yourls)
* [Charts respective READMEs](charts)
* ```
helm search yourls
```
6 changes: 6 additions & 0 deletions charts/yourls/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 7.3.16
digest: sha256:018d0ec922caa444faa8daec62f9f0a46322de77d27da44753b1549378e998cf
generated: "2020-03-30T20:43:17.5244117+02:00"
14 changes: 10 additions & 4 deletions charts/yourls/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
apiVersion: v2
name: yourls
description: Your Own URL Shortener
version: 1.1.4
appVersion: 1.7.3
version: 1.2.0
appVersion: 1.7.4
keywords:
- shortener
- url
Expand All @@ -14,4 +14,10 @@ sources:
maintainers:
- name: YOURLS
email: [email protected]
engine: gotpl
dependencies:
- name: mariadb
version: 7.3.16
repository: https://charts.bitnami.com/bitnami
condition: mariadb.enabled
tags:
- yourls-database
4 changes: 2 additions & 2 deletions charts/yourls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and man

## Prerequisites

- Kubernetes 1.4+ with Beta APIs enabled
- Kubernetes 1.15+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure

## Installing the Chart
Expand Down Expand Up @@ -126,7 +126,7 @@ The above command sets the YOURLS administrator account username and password to
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

```console
$ helm install --name my-release -f values.yaml yourls/yourls
$ helm install my-release -f values.yaml yourls/yourls
```

> **Tip**: You can use the default [values.yaml](values.yaml)
Expand Down
6 changes: 0 additions & 6 deletions charts/yourls/requirements.lock

This file was deleted.

7 changes: 0 additions & 7 deletions charts/yourls/requirements.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/yourls/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled }}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ template "yourls.fullname" . }}
Expand Down
10 changes: 9 additions & 1 deletion charts/yourls/templates/tests/test-mariadb-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ spec:
- name: {{ .Release.Name }}-credentials-test
image: {{ template "yourls.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
env:
- name: MARIADB_HOST
value: {{ template "mariadb.fullname" . }}
Expand All @@ -24,6 +28,10 @@ spec:
secretKeyRef:
name: {{ template "mariadb.fullname" . }}
key: mariadb-password
command: ["sh", "-c", "mysql --host=$YOURLS_DB_HOST --user=$YOURLS_DB_USER --password=$YOURLS_DB_PASS"]
command:
- /bin/bash
- -ec
- |
mysql --host=$MARIADB_HOST --port=$MARIADB_PORT --user=$YOURLS_DB_USER --password=$YOURLS_DB_PASS
restartPolicy: Never
{{- end }}
17 changes: 15 additions & 2 deletions charts/yourls/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
image:
registry: docker.io
repository: yourls
tag: 1.7.3
tag: 1.7.4
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
Expand Down Expand Up @@ -70,7 +70,7 @@ externalDatabase:
##
## MariaDB chart configuration
##
## https://github.com/helm/charts/blob/master/stable/mariadb/values.yaml
## https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml
##
mariadb:
## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters
Expand All @@ -79,6 +79,10 @@ mariadb:
replication:
enabled: false

## Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
volumePermissions:
enabled: true

## Create a database and a database user
## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
##
Expand Down Expand Up @@ -249,6 +253,15 @@ affinity: {}
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations: {}

## K8s Security Context for WordPress pods
## https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001

## Prometheus Exporter / Metrics
##
metrics:
Expand Down
4 changes: 1 addition & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package-path: public
remote: origin
chart-dirs:
- charts
excluded-charts:
- common
helm-extra-args: --timeout 800
helm-extra-args: --timeout 800s
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami

0 comments on commit 0fb1d3d

Please sign in to comment.