Skip to content

Commit

Permalink
Project init
Browse files Browse the repository at this point in the history
  • Loading branch information
juadk committed Nov 4, 2021
1 parent a64e30a commit afbc6df
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.1

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.3.0

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

# TODO test inside kind cluster does not work
# Need to debug this
# - name: Create kind cluster
# uses: helm/[email protected]
# if: steps.list-changed.outputs.changed == 'true'

#- name: Run chart-testing (install)
# run: ct install --config ct.yaml
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Charts

on:
push:
branches:
- main
repository_dispatch:
types: [epinio-release]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Print the latest tag
run: |
echo ${{ github.event.client_payload.ref }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: chart
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
25 changes: 25 additions & 0 deletions .github/workflows/sync-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sync README files

on:
push:
branches:
- 'main'
paths:
- 'README.md'
jobs:
sync-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v2
with:
ref: gh-pages
- run: |
cp -f ${{ runner.temp }}/README.md .
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add README.md
git commit --signoff -m "Sync README from main"
git push
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# epinio-helm-chart
Epinio Helm chart
<img src="./assets/epinio.png" align="right" width="200" height="50%">

## Usage

[Helm](https://helm.sh) must be installed to use the chart. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

helm repo add epinio-helm-chart https://epinio.github.io/epinio-helm-chart

If you had already added this repo earlier, run `helm repo update` to fetch
the latest versions of the package. You can then run `helm search repo
epinio-helm-chart` to see the chart.

To install the epinio chart:

helm install my-epinio epinio-helm-chart/epinio

At the end of the installation, usefull information will be printed to help you to start working with your fresh Epinio deployment.

To uninstall the chart:

helm delete my-epinio

## Helm chart repo

This repo is also used as Helm chart repository by publishing the index.yaml through github-pages feature.
https://epinio.github.io/epinio-helm-chart/index.yaml

We are using the chart-releaser-action github action to automatically publish the new chart version when an epinio release is out.
Binary file added assets/epinio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions chart/epinio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
name: epinio
version: 0.1.1
appVersion: 0.1.4
description: From app to URL in one command
home: https://github.com/epinio/epinio
icon: https://raw.githubusercontent.com/epinio/epinio/main/docs/epinio.svg
keywords:
- epinio
- paas
sources:
- https://github.com/epinio/epinio
maintainers:
- name: SUSE
email: [email protected]
6 changes: 6 additions & 0 deletions chart/epinio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Epinio Helm Chart

## Introduction

This helm chart can be used to deploy Epinio on a cluster. It is an alternative
to `epinio install` command.
15 changes: 15 additions & 0 deletions chart/epinio/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{{- if .Values.domain }}
You can get the IP address of your Ingress controller by passing this command:
`kubectl describe svc traefik --namespace traefik | grep Ingress | awk '{print $3}'`

Make sure your domain points to the IP address of your Ingress controller (1.2.3.4).
{{ end }}
To interract with your Epinio installation, you have to download the latest epinio binary https://github.com/epinio/epinio/releases.

Update the api location and credentials with:
`epinio config update`

Then, you have to run `epinio namespace create workspace`

For more information about Epinio, feel free to checkout https://epinio.io/ and https://docs.epinio.io/.
69 changes: 69 additions & 0 deletions chart/epinio/templates/post-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "post-install-{{ .Release.Name }}"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": hook-succeeded, before-hook-creation
spec:
backoffLimit: 0
template:
metadata:
name: "{{ .Release.Name }}"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
restartPolicy: Never
serviceAccountName: epinio-installer
containers:
- name: install
image: "juadk/epinio-installer:v{{ .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
command:
- /epinio
args:
- install
- "--email-address={{ .Values.email | default "[email protected]"}}"
- "--tls-issuer={{ .Values.tlsIssuer | default "epinio-ca" }}"
- "--use-internal-registry-node-port={{ .Values.internalRegistryNodePort | default "true" }}"
- "--skip-default-namespace"
{{- if .Values.password }}
- "--password={{ .Values.password }}"
{{ end }}
{{- if .Values.user }}
- "--user={{ .Values.user }}"
{{ end }}
{{- if .Values.skipCertManager }}
- "--skip-cert-manager"
{{ end }}
{{- if .Values.skipLinkerd }}
- "--skip-linkerd"
{{ end }}
{{- if .Values.skipTraefik }}
- "--skip-traefik"
{{ end }}
{{- if .Values.domain }}
- "--system-domain={{ .Values.domain }}"
{{ end }}
{{- if .Values.s3Endpoint }}
- "--s3-endpoint={{ .Values.s3Endpoint }}"
- "--s3-access-key-id={{ .Values.s3AccessKeyId }}"
- "--s3-secret-access-key={{ .Values.s3SecretAccessKey }}"
- "--s3-bucket={{ .Values.s3Bucket }}"
{{ end }}
{{- if .Values.s3Location }}
- "--s3-location={{ .Values.s3Location }}"
{{ end }}
{{- if .Values.s3UseSSL }}
- "--s3-ssl={{ .Values.s3UseSSL }}"
{{ end }}
35 changes: 35 additions & 0 deletions chart/epinio/templates/pre-delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-delete-{{ .Release.Name }}"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": hook-succeeded, before-hook-creation
spec:
backoffLimit: 0
template:
metadata:
name: "{{ .Release.Name }}"
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
restartPolicy: Never
serviceAccountName: epinio-installer
containers:
- name: uninstall
image: "juadk/epinio-installer:v{{ .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
command:
- /epinio
args:
- uninstall
19 changes: 19 additions & 0 deletions chart/epinio/templates/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: epinio-installer
namespace: {{ .Release.Namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: epinio-installer
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: epinio-installer
namespace: "{{ .Release.Namespace }}"
43 changes: 43 additions & 0 deletions chart/epinio/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Default values for Carrier Helm Chart.
## This is a YAML-formatted file.
## Declare variables to be passed into your templates.

# The system domain to use for Carrier. Equivalent to `carrier install` system-domain
# parameter.

# The email address you are planning to use for getting notifications about your certificates (default "[email protected]")
email: "[email protected]"

# The name of the cluster issuer to use. Epinio creates three options: 'epinio-ca', 'letsencrypt-production', and 'selfsigned-issuer'. (default "epinio-ca")
tlsIssuer: "epinio-ca"

# The domain you are planning to use for Epinio. Should be pointing to the traefik public IP (Leave empty to use a omg.howdoi.website domain).
# domain: ""

# The user name for authenticating all API requests
# user: ""

# The password for authenticating all API requests
# password: ""

# Assert to epinio that cert-manager is already installed.
# skipCertManager: false

# Assert to epinio that Linkerd is already installed.
# skipLinkerd: false

# Assert to epinio that there is a Traefik active, even if epinio cannot find it.
# skipTraefik: false

# Make the internal registry accessible via a node port, so kubelet can access the registry without trusting its cert. (default true)
# internalRegistryNodePort

# If you are using your own S3 compatible object storage for blobs, set the following options:
# s3Endpoint:
# s3AccessKeyId:
# s3SecretAccessKey:
# s3Bucket:

# Optionnal
# s3Location:
# s3UseSSL:
6 changes: 6 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: main
chart-dirs:
- chart
helm-extra-args: --timeout 600s

0 comments on commit afbc6df

Please sign in to comment.