Skip to content
Snippets Groups Projects
Verified Commit 8661b1d7 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Add k9s deployment

parent 8a892d45
No related branches found
No related tags found
1 merge request!50Add k8s deployment
Pipeline #179479 failed
stages:
- build
- deploy
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
build docker image: build docker image:
stage: build
interruptible: true interruptible: true
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
...@@ -13,17 +18,14 @@ build docker image: ...@@ -13,17 +18,14 @@ build docker image:
--dockerfile $CI_PROJECT_DIR/Dockerfile --dockerfile $CI_PROJECT_DIR/Dockerfile
--destination $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
--cache=true --cache=true
--digestfile=DIGESTFILE
--cleanup --cleanup
build pages: deploy docker image:
image: alpine:latest stage: deploy
before_script: image: bitnami/kubectl:latest
- apk add --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ zola
- apk add yarn
- yarn install
script: script:
- zola build - cd deploy
- cp _redirects public/ - sed -i s/IMAGE_TAG/$CI_COMMIT_REF_NAME@sha256:$(cat DIGESTFILE)/g
artifacts: - cat deployment.yaml
paths: # - for file in *; do kubectl apply -f $file; done
- public/
apiVersion: apps/v1
kind: Deployment
metadata:
name: teckids-website
namespace: teckids-website
labels:
app: teckids-website
spec:
replicas: 3
selector:
matchLabels:
app: teckids-website
template:
metadata:
labels:
app: teckids-website
spec:
containers:
- name: caddy
image: registry.edugit.org/teckids/team-pr/teckids.org:IMAGE_TAG
ports:
- containerPort: 80
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/tls-acme: "true"
name: teckids-website-caddy
namespace: teckids-website
spec:
ingressClassName: nginx
rules:
- host: teckids.org
http:
paths:
- backend:
service:
name: teckids-website
port:
number: 80
path: /
pathType: Prefix
- host: www.teckids.org
http:
paths:
- backend:
service:
name: teckids-website
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- teckids.org
- www.teckids.org
secretName: teckids-website-tls
apiVersion: v1
kind: Service
metadata:
name: teckids-website
namespace: teckids-website
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
selector:
app: teckids-website
sessionAffinity: None
type: ClusterIP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment