dynamic-charts #19
@ -1 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
static
|
||||||
|
|
||||||
|
13
Dockerfile
13
Dockerfile
@ -1,16 +1,5 @@
|
|||||||
FROM alpine:latest AS builder
|
FROM klakegg/hugo
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . /src
|
COPY . /src
|
||||||
ARG GOHUGO_LINK=https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_0.110.0_linux-amd64.tar.gz
|
|
||||||
RUN apk update && apk add curl tar
|
|
||||||
RUN curl -LJO ${GOHUGO_LINK} && tar -xf hugo_0.110.0_linux-amd64.tar.gz
|
|
||||||
RUN mv /src/hugo /usr/local/bin/hugo
|
|
||||||
RUN chmod +x /usr/local/bin/hugo
|
|
||||||
RUN hugo
|
RUN hugo
|
||||||
|
|
||||||
FROM nginx:stable-alpine
|
|
||||||
COPY --from=builder /src/public /var/www
|
|
||||||
COPY configs/nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
EXPOSE 80
|
|
||||||
CMD [ "nginx", "-g", "daemon off;" ]
|
|
||||||
|
|
||||||
|
@ -24,35 +24,67 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
{{- include "badhouseplants-net.selectorLabels" . | nindent 8 }}
|
{{- include "badhouseplants-net.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.imagePullSecrets }}
|
initContainers:
|
||||||
imagePullSecrets:
|
- name: {{ .Values.rclone.container.name }}
|
||||||
{{- toYaml . | nindent 8 }}
|
image: "{{ .Values.rclone.image.repository}}:{{ .Values.rclone.image.tag}}"
|
||||||
{{- end }}
|
imagePullPolicy: {{ .Values.rclone.image.pullPolicy }}
|
||||||
securityContext:
|
env:
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
- name: RCLONE_CONFIG
|
||||||
|
value: /tmp/rclone.conf
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
args:
|
||||||
|
- "-c"
|
||||||
|
- "rclone copy -P badhouseplants-public:/badhouseplants-static /static"
|
||||||
|
volumeMounts:
|
||||||
|
- name: rclone-config
|
||||||
|
mountPath: "/tmp"
|
||||||
|
readOnly: true
|
||||||
|
- name: {{ .Values.volumes.rclone }}
|
||||||
|
mountPath: /static
|
||||||
|
readOnly: false
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.rclone.container.resources | nindent 12 }}
|
||||||
|
- name: {{ .Values.hugo.container.name }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: {{ .Values.volumes.rclone.name }}
|
||||||
|
mountPath: /src/static
|
||||||
|
readOnly: true
|
||||||
|
- name: {{ .Values.volumes.public.name }}
|
||||||
|
mountPath: /src/public
|
||||||
|
readOnly: false
|
||||||
|
image: "{{ .Values.hugo.image.repository}}:{{ .Values.hugo.image.tag}}"
|
||||||
|
imagePullPolicy: {{ .Values.hugo.image.pullPolicy }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.hugo.container.resources | nindent 12 }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Values.nginx.container.name }}
|
||||||
securityContext:
|
image: "{{ .Values.nginx.image.repository}}:{{ .Values.nginx.image.tag}}"
|
||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.service.port }}
|
containerPort: {{ .Values.service.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.nginx.container.resources | nindent 12 }}
|
||||||
command:
|
volumeMounts:
|
||||||
{{ toYaml .Values.command | indent 12 }}
|
- name: {{ .Values.volumes.public.name }}
|
||||||
{{- with .Values.nodeSelector }}
|
mountPath: /var/www
|
||||||
nodeSelector:
|
readOnly: true
|
||||||
{{- toYaml . | nindent 8 }}
|
- name: nginx-config
|
||||||
{{- end }}
|
mountPath: /etc/nginx/conf.d
|
||||||
{{- with .Values.affinity }}
|
readOnly: true
|
||||||
affinity:
|
volumes:
|
||||||
{{- toYaml . | nindent 8 }}
|
- name: rclone-config
|
||||||
{{- end }}
|
secret:
|
||||||
{{- with .Values.tolerations }}
|
secretName: rclone-config
|
||||||
tolerations:
|
- name: {{ .Values.volumes.rclone.name }}
|
||||||
{{- toYaml . | nindent 8 }}
|
emptyDir:
|
||||||
{{- end }}
|
sizeLimit: {{ .Values.volumes.rclone.sizeLimit }}
|
||||||
|
- name: {{ .Values.volumes.public.name }}
|
||||||
|
emptyDir:
|
||||||
|
sizeLimit: {{ .Values.volumes.public.sizeLimit }}
|
||||||
|
- name: nginx-config
|
||||||
|
configMap:
|
||||||
|
name: nginx-config
|
||||||
|
|
||||||
|
17
chart/templates/nginx-config-cm.yaml
Normal file
17
chart/templates/nginx-config-cm.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: nginx-config
|
||||||
|
data:
|
||||||
|
default.conf: |
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name ~.;
|
||||||
|
root /var/www;
|
||||||
|
index index.html;
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
8
chart/templates/rclone-config-sec.yaml
Normal file
8
chart/templates/rclone-config-sec.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: rclone-config
|
||||||
|
type: generic
|
||||||
|
data:
|
||||||
|
# the data is abbreviated in this example
|
||||||
|
rclone.conf: {{ .Values.rclone.config | b64enc }}
|
21
chart/templates/virtual-service.yaml
Normal file
21
chart/templates/virtual-service.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{{- if .Values.istio.enabled -}}
|
||||||
|
apiVersion: networking.istio.io/v1beta1
|
||||||
|
kind: VirtualService
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
labels:
|
||||||
|
name: blog-virtual-service
|
||||||
|
spec:
|
||||||
|
gateways:
|
||||||
|
- istio-system/badhouseplants-net
|
||||||
|
hosts: {{ .Values.istio.hosts }}
|
||||||
|
http:
|
||||||
|
- match:
|
||||||
|
- uri:
|
||||||
|
prefix: {{ .Values.istio.prefix }}
|
||||||
|
route:
|
||||||
|
- destination:
|
||||||
|
host: {{ include "badhouseplants-net.fullname" . }}
|
||||||
|
port:
|
||||||
|
number: {{ .Values.service.port }}
|
||||||
|
{{- end }}
|
@ -1,10 +1,66 @@
|
|||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
image:
|
nginx:
|
||||||
repository: git.badhouseplants.net/allanger/badhouseplants-net
|
container:
|
||||||
pullPolicy: Always
|
name: nginx
|
||||||
tag: latest
|
resources: {}
|
||||||
|
image:
|
||||||
|
repository: nginx
|
||||||
|
pullPolicy: Always
|
||||||
|
tag: latest
|
||||||
|
|
||||||
|
rclone:
|
||||||
|
container:
|
||||||
|
name: rclone
|
||||||
|
resources: {}
|
||||||
|
image:
|
||||||
|
repository: rclone/rclone
|
||||||
|
pullPolicy: Always
|
||||||
|
tag: latest
|
||||||
|
config: |-
|
||||||
|
[badhouseplants-public]
|
||||||
|
type = s3
|
||||||
|
provider = Minio
|
||||||
|
region = us-west-1
|
||||||
|
endpoint = s3.badhouseplants.net
|
||||||
|
location_constraint = us-west-1
|
||||||
|
|
||||||
|
hugo:
|
||||||
|
container:
|
||||||
|
name: badhouseplants-net
|
||||||
|
resources: {}
|
||||||
|
image:
|
||||||
|
repository: git.badhouseplants.net/allanger/badhouseplants-net
|
||||||
|
pullPolicy: Always
|
||||||
|
tag: latest
|
||||||
|
|
||||||
|
istio:
|
||||||
|
enabled: true
|
||||||
|
hosts:
|
||||||
|
- badhouseplants.net
|
||||||
|
- www.badhouseplants.net
|
||||||
|
prefix: /
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# ----------------------------------------------
|
||||||
|
# -- An emptydir volume where hugo should
|
||||||
|
# -- put the static content
|
||||||
|
# ----------------------------------------------
|
||||||
|
public:
|
||||||
|
name: public-content
|
||||||
|
sizeLimit: 1gi
|
||||||
|
# ----------------------------------------------
|
||||||
|
# -- An emptydir volume where rclone should
|
||||||
|
# -- download pictures
|
||||||
|
# ----------------------------------------------
|
||||||
|
rclone:
|
||||||
|
name: s3-data
|
||||||
|
sizeLimit: 1Gi
|
||||||
|
|
||||||
|
# -------------------------------------
|
||||||
|
# -- Default values that I haven't
|
||||||
|
# -- touched
|
||||||
|
# -------------------------------------
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
@ -30,29 +86,6 @@ service:
|
|||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
annotations:
|
|
||||||
kubernetes.io/ingress.class: istio
|
|
||||||
hosts:
|
|
||||||
- host: badhouseplants.net
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: Prefix
|
|
||||||
tls:
|
|
||||||
- secretName: badhouseplants-wildcard-tls
|
|
||||||
hosts:
|
|
||||||
- badhouseplants.net
|
|
||||||
|
|
||||||
resources: {}
|
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
|
||||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
|
||||||
# limits:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
# requests:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
|
|
||||||
autoscaling:
|
autoscaling:
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -60,9 +93,3 @@ autoscaling:
|
|||||||
maxReplicas: 100
|
maxReplicas: 100
|
||||||
targetCPUUtilizationPercentage: 80
|
targetCPUUtilizationPercentage: 80
|
||||||
# targetMemoryUtilizationPercentage: 80
|
# targetMemoryUtilizationPercentage: 80
|
||||||
|
|
||||||
nodeSelector: {}
|
|
||||||
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
affinity: {}
|
|
||||||
|
Reference in New Issue
Block a user