Merge branch 'develop' into 'devops-staging'
add deployment See merge request empatnusabangsa/ppob/ppob-frontend!94
This commit is contained in:
commit
855ac66a0a
|
@ -48,7 +48,7 @@ build-production:
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- docker login $REGISTRY_URL -u $NWP_REGISTRY_USER -p $NWP_REGISTRY_PASS
|
- docker login $REGISTRY_URL -u $BKA_REGISTRY_USER -p $BKA_REGISTRY_PASS
|
||||||
- docker build -t $REGISTRY_IMAGE:$VERSION_PRODUCTION .
|
- docker build -t $REGISTRY_IMAGE:$VERSION_PRODUCTION .
|
||||||
- docker push $REGISTRY_IMAGE:$VERSION_PRODUCTION
|
- docker push $REGISTRY_IMAGE:$VERSION_PRODUCTION
|
||||||
- docker rmi $REGISTRY_IMAGE:$VERSION_PRODUCTION
|
- docker rmi $REGISTRY_IMAGE:$VERSION_PRODUCTION
|
||||||
|
@ -59,9 +59,9 @@ deploy-production:
|
||||||
only:
|
only:
|
||||||
- devops-production
|
- devops-production
|
||||||
script:
|
script:
|
||||||
- kubectl config set-cluster k8s --server="${NWP_CLUSTER_HOST}"
|
- kubectl config set-cluster k8s --server="${BKA_CLUSTER_HOST}"
|
||||||
- kubectl config set clusters.k8s.certificate-authority-data ${NWP_CLUSTER_CA}
|
- kubectl config set clusters.k8s.certificate-authority-data ${BKA_CLUSTER_CA}
|
||||||
- kubectl config set-credentials gitlab --token="${NWP_CLUSTER_TOKEN}"
|
- kubectl config set-credentials gitlab --token="${BKA_CLUSTER_TOKEN}"
|
||||||
- kubectl config set-context default --cluster=k8s --user=gitlab
|
- kubectl config set-context default --cluster=k8s --user=gitlab
|
||||||
- kubectl config use-context default
|
- kubectl config use-context default
|
||||||
- sed -i "s/<VERSION>/${VERSION_PRODUCTION}/g" k8s/production/deployment.yaml
|
- sed -i "s/<VERSION>/${VERSION_PRODUCTION}/g" k8s/production/deployment.yaml
|
||||||
|
|
22
k8s/production/deployment.yaml
Normal file
22
k8s/production/deployment.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: ppob-frontend
|
||||||
|
namespace: empatnusabangsa-production
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: ppob-frontend
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: ppob-frontend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: ppob-frontend
|
||||||
|
image: registry-harbor.app.bangun-kreatif.com/empatnusabangsa/ppob-frontend:<VERSION>
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
24
k8s/production/ingress.yaml
Normal file
24
k8s/production/ingress.yaml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: ppob-frontend-ingress
|
||||||
|
namespace: empatnusabangsa-production
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: "traefik"
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: "wndsolutions.id"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- pathType: Prefix
|
||||||
|
path: /
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: ppob-frontend
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- "wndsolutions.id"
|
||||||
|
secretName: wndsolutions-id-tls
|
9
k8s/production/middleware.yaml
Normal file
9
k8s/production/middleware.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: redirect-https
|
||||||
|
namespace: empatnusabangsa-production
|
||||||
|
spec:
|
||||||
|
redirectScheme:
|
||||||
|
scheme: https
|
||||||
|
permanent: true
|
4
k8s/production/namespace.yaml
Normal file
4
k8s/production/namespace.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: empatnusabangsa-staging
|
13
k8s/production/service.yaml
Normal file
13
k8s/production/service.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: ppob-frontend
|
||||||
|
namespace: empatnusabangsa-production
|
||||||
|
labels:
|
||||||
|
run: ppob-frontend
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
app: ppob-frontend
|
Loading…
Reference in New Issue
Block a user