k8s installer

This commit is contained in:
Waylon Walker 2023-11-05 14:28:38 -06:00
parent 225ec58243
commit 8af5e75966
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
5 changed files with 167 additions and 24 deletions

View file

@ -1,6 +1,6 @@
FROM alpine
RUN apk update && apk add bash curl
workdir /app
WORKDIR /app
RUN curl -s https://i.jpillora.com/installer | bash
EXPOSE 3003
CMD /app/installer

144
installer/deployment.yaml Normal file
View file

@ -0,0 +1,144 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n installer
kompose.image-pull-secret: regcred
kompose.service.expose: installer.wayl.one,installer.k.waylonwalker.com,i.wayl.one,i.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: installer
name: installer
namespace: installer
spec:
ports:
- name: "3003"
port: 3003
targetPort: 3003
selector:
io.kompose.service: installer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: installer
namespace: installer
spec: {}
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n installer
kompose.image-pull-secret: regcred
kompose.service.expose: installer.wayl.one,installer.k.waylonwalker.com,i.wayl.one,i.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: installer
name: installer
namespace: installer
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: installer
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n installer
kompose.image-pull-secret: regcred
kompose.service.expose: installer.wayl.one,installer.k.waylonwalker.com,i.wayl.one,i.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/installer-default: "true"
io.kompose.service: installer
spec:
containers:
- env:
- name: HTTP_HOST
value: 0.0.0.0
- name: PORT
value: "3003"
- name: USER
value: waylonwalker
image: registry.wayl.one/installer
name: installer
ports:
- containerPort: 3003
protocol: TCP
resources: {}
imagePullSecrets:
- name: regcred
restartPolicy: Always
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n installer
kompose.image-pull-secret: regcred
kompose.service.expose: installer.wayl.one,installer.k.waylonwalker.com,i.wayl.one,i.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: installer
name: installer
namespace: installer
spec:
rules:
- host: installer.wayl.one
http:
paths:
- backend:
service:
name: installer
port:
number: 3003
path: /
pathType: Prefix
- host: installer.k.waylonwalker.com
http:
paths:
- backend:
service:
name: installer
port:
number: 3003
path: /
pathType: Prefix
- host: i.wayl.one
http:
paths:
- backend:
service:
name: installer
port:
number: 3003
path: /
pathType: Prefix
- host: i.k.waylonwalker.com
http:
paths:
- backend:
service:
name: installer
port:
number: 3003
path: /
pathType: Prefix
status:
loadBalancer: {}

View file

@ -2,33 +2,15 @@ version: "3"
services:
installer:
image: installer
build: ../installer
image: registry.wayl.one/installer
container_name: installer
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 3003:3003
- 3003
environment:
- HTTP_HOST=0.0.0.0
- PORT=3003
- USER=waylonwalker
- REPO=waylonwalker.com
labels:
- "traefik.enable=true"
- "traefik.http.routers.installer.entrypoints=http"
- "traefik.http.routers.installer.rule=Host(`installer.${URL}`)"
- "traefik.http.middlewares.installer-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.installer.middlewares=installer-https-redirect"
- "traefik.http.routers.installer-secure.entrypoints=https"
- "traefik.http.routers.installer-secure.rule=Host(`installer.${URL}`)"
- "traefik.http.routers.installer-secure.tls=true"
- "traefik.http.routers.installer-secure.service=installer"
- "traefik.http.services.installer.loadbalancer.server.port=3003"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true
kompose.service.expose: installer.wayl.one,installer.k.waylonwalker.com,i.wayl.one,i.k.waylonwalker.com
kompose.image-pull-secret: regcred

BIN
installer/installer-k8s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

17
installer/justfile Normal file
View file

@ -0,0 +1,17 @@
default: convert deploy viz
regcred:
kubectl get secret -n default regcred --output=yaml -o yaml | sed 's/namespace: default/namespace: installer/' | kubectl apply -n installer -f - && echo deployed secret || echo secret exists
build:
docker build -t registry.wayl.one/i .
docker push registry.wayl.one/i:latest
docker tag registry.wayl.one/i registry.wayl.one/i:$(date +%Y%m%d%H%M)
docker push registry.wayl.one/i:$(date +%Y%m%d%H%M)
convert:
kompose convert -o deployment.yaml -n installer
deploy:
kubectl apply -f deployment.yaml
viz:
k8sviz -n installer --kubeconfig $KUBECONFIG -t png -o installer-k8s.png
restart:
kubectl rollout restart -n installer deployment/installer