mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Updates for production deployment: gitlab-ci.yaml, values, disable cron service
This commit is contained in:
parent
96dc7647fc
commit
bd9aebc5fe
@ -29,14 +29,8 @@ variables:
|
||||
kubectl config set-cluster cluster --server="$KUBE_URL" --certificate-authority="$HOME/ca.pem" &&
|
||||
kubectl config set-credentials cluster --token="$KUBE_TOKEN" && kubectl config set-context cluster --cluster=cluster --user=cluster --namespace="$KUBE_NAMESPACE" &&
|
||||
kubectl config use-context cluster
|
||||
#- &KUBEAPPLY
|
||||
#- kubectl apply -f <(envsubst <etc/kube/service_template.yaml) &&
|
||||
#- kubectl apply -f <(envsubst <etc/kube/hoogle_service_template.yaml) &&
|
||||
#- kubectl apply -f <(envsubst <etc/kube/deployment_template.yaml) &&
|
||||
#- kubectl apply -f <(envsubst <etc/kube/cron_deployment_template.yaml) &&
|
||||
#- kubectl apply -f <(envsubst <etc/kube/hoogle_deployment_template.yaml)
|
||||
- &HELMUPGRADE
|
||||
helm --tiller-namespace ${KUBE_NAMESPACE} upgrade -i "${DEPLOYMENT_NAME}" etc/helm --set name="${DEPLOYMENT_NAME}" --set app="${DEPLOYMENT_APP}" --set hoogleName="${HOOGLE_DEPLOYMENT_NAME}" --set hoogleApp="${HOOGLE_DEPLOYMENT_APP}" --set cronName="${CRON_DEPLOYMENT_NAME}" --set cronApp="${HOOGLE_DEPLOYMENT_APP}" --set image.image="${DEPLOYMENT_IMAGE}" --values etc/helm/values/$CI_ENVIRONMENT_NAME.yaml --namespace ${KUBE_NAMESPACE}
|
||||
helm --tiller-namespace ${KUBE_NAMESPACE} upgrade --install "${DEPLOYMENT_NAME}" etc/helm --set name="${DEPLOYMENT_NAME}" --set app="${DEPLOYMENT_APP}" --set hoogleName="${HOOGLE_DEPLOYMENT_NAME}" --set hoogleApp="${HOOGLE_DEPLOYMENT_APP}" --set cronName="${CRON_DEPLOYMENT_NAME}" --set cronApp="${HOOGLE_DEPLOYMENT_APP}" --set image.image="${DEPLOYMENT_IMAGE}" --values etc/helm/values/$CI_ENVIRONMENT_NAME.yaml --namespace ${KUBE_NAMESPACE}
|
||||
- &HELMCHECK
|
||||
helm --tiller-namespace ${KUBE_NAMESPACE} ls &&
|
||||
helm --tiller-namespace ${KUBE_NAMESPACE} status "${DEPLOYMENT_NAME}"
|
||||
@ -65,7 +59,7 @@ deploy_prod:
|
||||
only:
|
||||
- production-deployment
|
||||
environment:
|
||||
name: stackage-server-prod
|
||||
name: production
|
||||
url: https://www.stackage.org/
|
||||
variables:
|
||||
CRON_DEPLOYMENT_NAME: "stackage-server-cron-prod"
|
||||
@ -75,17 +69,12 @@ deploy_prod:
|
||||
PROD_DEPLOYMENT_IMAGE: "fpco/stackage-server-prod:${CI_BUILD_REF_SLUG}_${CI_PIPELINE_ID}"
|
||||
script:
|
||||
- export
|
||||
KUBE_CA_PEM="$PROD_KUBE_CA_PEM"
|
||||
KUBE_URL="$PROD_KUBE_URL"
|
||||
KUBE_TOKEN="$PROD_KUBE_TOKEN"
|
||||
KUBE_NAMESPACE="$PROD_KUBE_NAMESPACE"
|
||||
KUBE_CA_PEM="$PROD_V2_KUBE_CA_PEM"
|
||||
KUBE_URL="$PROD_V2_KUBE_URL"
|
||||
KUBE_TOKEN="$PROD_V2_KUBE_TOKEN"
|
||||
KUBE_NAMESPACE="$PROD_V2_KUBE_NAMESPACE"
|
||||
- *KUBELOGIN
|
||||
- docker login -u "$PROD_DOCKER_USERNAME" -p "${PROD_DOCKER_PASSWORD}"
|
||||
- docker tag "$DEPLOYMENT_IMAGE" "$PROD_DEPLOYMENT_IMAGE"
|
||||
- docker push "$PROD_DEPLOYMENT_IMAGE"
|
||||
- docker tag "$DEPLOYMENT_IMAGE" "fpco/stackage-server-prod:latest"
|
||||
- docker push "fpco/stackage-server-prod:latest"
|
||||
- helm --tiller-namespace ${KUBE_NAMESPACE} upgrade --dry-run -i "${PROD_DEPLOYMENT_NAME}" etc/helm --set name="${DEPLOYMENT_NAME}" --set app="${DEPLOYMENT_APP}" --set hoogleName="${HOOGLE_DEPLOYMENT_NAME}" --set hoogleApp="${HOOGLE_DEPLOYMENT_APP}" --set cronName="${CRON_DEPLOYMENT_NAME}" --set cronApp="${HOOGLE_DEPLOYMENT_APP}" --set image.image="${DEPLOYMENT_IMAGE}" --values etc/helm/values/$CI_ENVIRONMENT_NAME.yaml --namespace ${KUBE_NAMESPACE}
|
||||
- *HELMUPGRADE
|
||||
- *HELMCHECK
|
||||
|
||||
deploy_ci:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
{{- if .Values.cron.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@ -14,7 +15,7 @@ spec:
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-key
|
||||
- name: {{ .Values.registrySecretName }}
|
||||
volumes:
|
||||
- name: stackage-server-cron-volume
|
||||
secret:
|
||||
@ -62,3 +63,4 @@ spec:
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@ -12,7 +12,7 @@ spec:
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-key
|
||||
- name: {{ .Values.registrySecretName }}
|
||||
containers:
|
||||
- name: stackage-server
|
||||
image: {{ .Values.image.image }}
|
||||
|
||||
@ -12,7 +12,7 @@ spec:
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-key
|
||||
- name: {{ .Values.registrySecretName }}
|
||||
containers:
|
||||
- name: stackage-server-hoogle
|
||||
image: {{ .Values.image.image }}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#cronApp: stackage-server-cron-prod
|
||||
|
||||
image:
|
||||
replicas: 1
|
||||
replicas: 2
|
||||
replicasHoggle: 2
|
||||
env:
|
||||
approot: "https://stackage.org"
|
||||
@ -32,3 +32,8 @@ cronResources:
|
||||
limits:
|
||||
cpu: 300m
|
||||
memory: 4096Mi
|
||||
|
||||
cron:
|
||||
enabled: false
|
||||
|
||||
registrySecretName: gitlab-ci-registrykey
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
image:
|
||||
replicas: 1
|
||||
replicasHoggle: 2
|
||||
replicasHoggle: 1
|
||||
env:
|
||||
approot: "https://ci.stackage.org"
|
||||
|
||||
@ -32,3 +32,5 @@ cronResources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 2096Mi
|
||||
|
||||
registrySecretName: registry-key
|
||||
|
||||
Loading…
Reference in New Issue
Block a user