diff --git a/installer/Dockerfile b/installer/Dockerfile index 4d10a11..19e1810 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -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 diff --git a/installer/deployment.yaml b/installer/deployment.yaml new file mode 100644 index 0000000..e5d2724 --- /dev/null +++ b/installer/deployment.yaml @@ -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: {} + diff --git a/installer/docker-compose.yml b/installer/docker-compose.yml index b47f679..30b5984 100644 --- a/installer/docker-compose.yml +++ b/installer/docker-compose.yml @@ -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 diff --git a/installer/installer-k8s.png b/installer/installer-k8s.png new file mode 100644 index 0000000..a2e963a Binary files /dev/null and b/installer/installer-k8s.png differ diff --git a/installer/justfile b/installer/justfile new file mode 100644 index 0000000..3f383e0 --- /dev/null +++ b/installer/justfile @@ -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