Add button app to charts
Add button app to test ingress-nginx
This commit is contained in:
@@ -21,5 +21,6 @@ rsync -r $CHART_PATH/ charts/$APP/$VERSION
|
||||
touch charts/$APP/$VERSION/questions.yaml
|
||||
touch charts/$APP/item.yaml
|
||||
cp $APP_PATH/README.md charts/$APP/$VERSION
|
||||
cp charts/$APP/$VERSION/README.md charts/$APP/$VERSION/app-readme.md
|
||||
cp charts/$APP/$VERSION/values.yaml charts/$APP/$VERSION/ix_values.yaml
|
||||
```
|
||||
|
||||
23
charts/button/1.0.0/.helmignore
Normal file
23
charts/button/1.0.0/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
23
charts/button/1.0.0/Chart.yaml
Normal file
23
charts/button/1.0.0/Chart.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: v2
|
||||
name: button
|
||||
description: A Button Website for demonstrating Docker and Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 1.0.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 1.0.0
|
||||
55
charts/button/1.0.0/README.md
Normal file
55
charts/button/1.0.0/README.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# CI Builder
|
||||
|
||||
My CI testing pipeline for a django project.
|
||||
|
||||
[](https://gitlab.ducoterra.net/ducoterra/ci_builder/-/commits/master)
|
||||
|
||||
## Prereqs
|
||||
|
||||
1. Docker: https://www.docker.com/products/docker-desktop
|
||||
2. kubectl: https://kubernetes.io/docs/tasks/tools/#kubectl
|
||||
3. helm: https://helm.sh/docs/intro/install/
|
||||
4. k3d: https://k3d.io/
|
||||
5. You'll be using "*.localhost" domains for testing. This means you'll either have to use Chrome (which has these built in) or firefox. In Firefox:
|
||||
|
||||
1. Type `about:config` in the url field of your browser and press enter
|
||||
2. Search for `network.dns.localDomains`
|
||||
3. Double click to edit the field
|
||||
4. Add these values: `button.localhost, pgadmin.localhost, traefik.localhost`
|
||||
5. As you build your own sites you can add more to test!
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
# build the docker image. This uses the build step from docker-compose.yml.
|
||||
docker compose build
|
||||
|
||||
# Now start postgres, pgadmin and traefik
|
||||
docker compose up -d postgres pgadmin traefik
|
||||
|
||||
# Navigate to http://traefik.localhost to see your ingress routes
|
||||
|
||||
# View the logs to check the container status
|
||||
docker compose logs
|
||||
|
||||
# Now start the init container and wait for migrations to apply
|
||||
docker compose up init
|
||||
|
||||
# Now start the button container
|
||||
docker compose up -d button
|
||||
|
||||
# View the site logs
|
||||
docker compose logs --follow button
|
||||
|
||||
# Navigate to http://button.localhost
|
||||
|
||||
# Take down the site
|
||||
docker compose down
|
||||
```
|
||||
|
||||
## K3D
|
||||
|
||||
```bash
|
||||
# Create a cluster for our button app
|
||||
k3d cluster create button -p "80:8000@loadbalancer" --volume $HOME/.kube/registries.yaml:/var/lib/rancher/k3s/registries.yaml
|
||||
```
|
||||
55
charts/button/1.0.0/app-readme.md
Normal file
55
charts/button/1.0.0/app-readme.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# CI Builder
|
||||
|
||||
My CI testing pipeline for a django project.
|
||||
|
||||
[](https://gitlab.ducoterra.net/ducoterra/ci_builder/-/commits/master)
|
||||
|
||||
## Prereqs
|
||||
|
||||
1. Docker: https://www.docker.com/products/docker-desktop
|
||||
2. kubectl: https://kubernetes.io/docs/tasks/tools/#kubectl
|
||||
3. helm: https://helm.sh/docs/intro/install/
|
||||
4. k3d: https://k3d.io/
|
||||
5. You'll be using "*.localhost" domains for testing. This means you'll either have to use Chrome (which has these built in) or firefox. In Firefox:
|
||||
|
||||
1. Type `about:config` in the url field of your browser and press enter
|
||||
2. Search for `network.dns.localDomains`
|
||||
3. Double click to edit the field
|
||||
4. Add these values: `button.localhost, pgadmin.localhost, traefik.localhost`
|
||||
5. As you build your own sites you can add more to test!
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
# build the docker image. This uses the build step from docker-compose.yml.
|
||||
docker compose build
|
||||
|
||||
# Now start postgres, pgadmin and traefik
|
||||
docker compose up -d postgres pgadmin traefik
|
||||
|
||||
# Navigate to http://traefik.localhost to see your ingress routes
|
||||
|
||||
# View the logs to check the container status
|
||||
docker compose logs
|
||||
|
||||
# Now start the init container and wait for migrations to apply
|
||||
docker compose up init
|
||||
|
||||
# Now start the button container
|
||||
docker compose up -d button
|
||||
|
||||
# View the site logs
|
||||
docker compose logs --follow button
|
||||
|
||||
# Navigate to http://button.localhost
|
||||
|
||||
# Take down the site
|
||||
docker compose down
|
||||
```
|
||||
|
||||
## K3D
|
||||
|
||||
```bash
|
||||
# Create a cluster for our button app
|
||||
k3d cluster create button -p "80:8000@loadbalancer" --volume $HOME/.kube/registries.yaml:/var/lib/rancher/k3s/registries.yaml
|
||||
```
|
||||
3
charts/button/1.0.0/ix_values.yaml
Normal file
3
charts/button/1.0.0/ix_values.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
image: ducoterra/button
|
||||
tag: 1.0.2
|
||||
secret: true
|
||||
12
charts/button/1.0.0/questions.yaml
Normal file
12
charts/button/1.0.0/questions.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
groups:
|
||||
- name: "Let's Encrypt Config"
|
||||
description: "Let's Encrypt configuration details for cert-manager"
|
||||
- name: "Nginx Config"
|
||||
description: "Nginx configuration details"
|
||||
questions:
|
||||
- variable: email
|
||||
description: "Let's Encrypt Email"
|
||||
group: "Let's Encrypt Config"
|
||||
label: "Let's Encrypt Email"
|
||||
schema:
|
||||
type: string
|
||||
8
charts/button/1.0.0/templates/configmap.yaml
Normal file
8
charts/button/1.0.0/templates/configmap.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
labels:
|
||||
app: {{ .Release.Name }}
|
||||
data:
|
||||
ALLOWED_HOSTS: {{ .Release.Name }}.ducoterra.net
|
||||
33
charts/button/1.0.0/templates/deploy.yaml
Normal file
33
charts/button/1.0.0/templates/deploy.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- image: {{ required "A valid .Values.image entry required!" .Values.image }}:{{ required "A valid .Values.tag entry required!" .Values.tag }}
|
||||
name: {{ .Release.Name }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ .Release.Name }}
|
||||
- secretRef:
|
||||
name: {{ .Release.Name }}
|
||||
- secretRef:
|
||||
name: postgres
|
||||
resources:
|
||||
limits:
|
||||
memory: "500Mi"
|
||||
cpu: "250m"
|
||||
requests:
|
||||
memory: "1Mi"
|
||||
cpu: "100m"
|
||||
18
charts/button/1.0.0/templates/hpa.yaml
Normal file
18
charts/button/1.0.0/templates/hpa.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ .Release.Name }}
|
||||
minReplicas: 1
|
||||
maxReplicas: 4
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: 50
|
||||
23
charts/button/1.0.0/templates/ingress.yaml
Executable file
23
charts/button/1.0.0/templates/ingress.yaml
Executable file
@@ -0,0 +1,23 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
kubernetes.io/ingress.class: nginx
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
rules:
|
||||
- host: {{ .Release.Name }}.freenas.dnet
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: {{ .Release.Name }}
|
||||
port:
|
||||
number: 8000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
# tls:
|
||||
# - hosts:
|
||||
# - {{ .Release.Name }}.ducoterra.net
|
||||
# secretName: {{.Release.Name}}-tls-cert
|
||||
10
charts/button/1.0.0/templates/secret.yaml
Normal file
10
charts/button/1.0.0/templates/secret.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ if and .Values.secret .Release.IsInstall }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
type: generic
|
||||
data:
|
||||
SECRET_KEY: {{ randAlphaNum 64 | b64enc | quote }}
|
||||
DJANGO_SUPERUSER_PASSWORD: {{ randAlphaNum 64 | b64enc | quote }}
|
||||
{{ end }}
|
||||
15
charts/button/1.0.0/templates/service.yaml
Normal file
15
charts/button/1.0.0/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Release.Name }}
|
||||
name: {{ .Release.Name }}
|
||||
spec:
|
||||
ports:
|
||||
- port: 8000
|
||||
protocol: TCP
|
||||
name: {{ .Release.Name }}-web
|
||||
targetPort: 8000
|
||||
selector:
|
||||
app: {{ .Release.Name }} # This selects the pod(s) that match the selector
|
||||
type: ClusterIP
|
||||
3
charts/button/1.0.0/values.yaml
Normal file
3
charts/button/1.0.0/values.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
image: ducoterra/button
|
||||
tag: 1.0.2
|
||||
secret: true
|
||||
3
charts/button/item.yaml
Normal file
3
charts/button/item.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
categories:
|
||||
- generic
|
||||
icon_url: "http://ix_url"
|
||||
Reference in New Issue
Block a user