Skip to content

Commit

Permalink
Added kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yureien committed Jun 7, 2023
1 parent c84f1d9 commit 1707e67
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ node_modules
build
package
**/.env
.env.example
32 changes: 32 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
stages:
- build
- release
- deploy

include:
- project: 'infrastructure/ci-scripts'
file: 'build-docker-image.yml'
- project: 'infrastructure/ci-scripts'
file: 'release-docker-image.yml'
- project: 'infrastructure/ci-scripts'
file: 'deploy-kustomize.yml'

build:
extends: .build_image
only:
- main

release:
extends: .release_image
only:
- main

deploy:
extends: .deploy_kustomize
variables:
KUSTOMIZE_OVERLAY: k8s
KUBERNETES_NAMESPACE: default
only:
- main
environment:
name: prod
57 changes: 57 additions & 0 deletions k8s/kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: v1
kind: Service
metadata:
name: bin-sohamsen-me
labels:
app: bin-sohamsen-me
service: bin-sohamsen-me
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
app: bin-sohamsen-me
status:
loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: bin-sohamsen-me
spec:
replicas: 1
selector:
matchLabels:
app: bin-sohamsen-me
template:
metadata:
labels:
app: bin-sohamsen-me
spec:
containers:
- image: registry.sohamsen.me/ghostdev/yabin:latest
imagePullPolicy: IfNotPresent
name: bin-sohamsen-me
ports:
- containerPort: 3000
envFrom:
- secretRef:
name: yabin-config
restartPolicy: Always
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bin-sohamsen-me
spec:
hosts:
- 'bin.sohamsen.me'
gateways:
- prod/sohamsen-me-gateway
http:
- route:
- destination:
host: bin-sohamsen-me
port:
number: 80
5 changes: 5 additions & 0 deletions k8s/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- kubernetes.yaml

0 comments on commit 1707e67

Please sign in to comment.