mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-24 18:01:57 +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-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 set-credentials cluster --token="$KUBE_TOKEN" && kubectl config set-context cluster --cluster=cluster --user=cluster --namespace="$KUBE_NAMESPACE" &&
|
||||||
kubectl config use-context cluster
|
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
|
- &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
|
- &HELMCHECK
|
||||||
helm --tiller-namespace ${KUBE_NAMESPACE} ls &&
|
helm --tiller-namespace ${KUBE_NAMESPACE} ls &&
|
||||||
helm --tiller-namespace ${KUBE_NAMESPACE} status "${DEPLOYMENT_NAME}"
|
helm --tiller-namespace ${KUBE_NAMESPACE} status "${DEPLOYMENT_NAME}"
|
||||||
@ -65,7 +59,7 @@ deploy_prod:
|
|||||||
only:
|
only:
|
||||||
- production-deployment
|
- production-deployment
|
||||||
environment:
|
environment:
|
||||||
name: stackage-server-prod
|
name: production
|
||||||
url: https://www.stackage.org/
|
url: https://www.stackage.org/
|
||||||
variables:
|
variables:
|
||||||
CRON_DEPLOYMENT_NAME: "stackage-server-cron-prod"
|
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}"
|
PROD_DEPLOYMENT_IMAGE: "fpco/stackage-server-prod:${CI_BUILD_REF_SLUG}_${CI_PIPELINE_ID}"
|
||||||
script:
|
script:
|
||||||
- export
|
- export
|
||||||
KUBE_CA_PEM="$PROD_KUBE_CA_PEM"
|
KUBE_CA_PEM="$PROD_V2_KUBE_CA_PEM"
|
||||||
KUBE_URL="$PROD_KUBE_URL"
|
KUBE_URL="$PROD_V2_KUBE_URL"
|
||||||
KUBE_TOKEN="$PROD_KUBE_TOKEN"
|
KUBE_TOKEN="$PROD_V2_KUBE_TOKEN"
|
||||||
KUBE_NAMESPACE="$PROD_KUBE_NAMESPACE"
|
KUBE_NAMESPACE="$PROD_V2_KUBE_NAMESPACE"
|
||||||
- *KUBELOGIN
|
- *KUBELOGIN
|
||||||
- docker login -u "$PROD_DOCKER_USERNAME" -p "${PROD_DOCKER_PASSWORD}"
|
- *HELMUPGRADE
|
||||||
- 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}
|
|
||||||
- *HELMCHECK
|
- *HELMCHECK
|
||||||
|
|
||||||
deploy_ci:
|
deploy_ci:
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
{{- if .Values.cron.enabled -}}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -14,7 +15,7 @@ spec:
|
|||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: registry-key
|
- name: {{ .Values.registrySecretName }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: stackage-server-cron-volume
|
- name: stackage-server-cron-volume
|
||||||
secret:
|
secret:
|
||||||
@ -62,3 +63,4 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
{{ toYaml . | indent 8 }}
|
{{ toYaml . | indent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ spec:
|
|||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: registry-key
|
- name: {{ .Values.registrySecretName }}
|
||||||
containers:
|
containers:
|
||||||
- name: stackage-server
|
- name: stackage-server
|
||||||
image: {{ .Values.image.image }}
|
image: {{ .Values.image.image }}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ spec:
|
|||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: registry-key
|
- name: {{ .Values.registrySecretName }}
|
||||||
containers:
|
containers:
|
||||||
- name: stackage-server-hoogle
|
- name: stackage-server-hoogle
|
||||||
image: {{ .Values.image.image }}
|
image: {{ .Values.image.image }}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#cronApp: stackage-server-cron-prod
|
#cronApp: stackage-server-cron-prod
|
||||||
|
|
||||||
image:
|
image:
|
||||||
replicas: 1
|
replicas: 2
|
||||||
replicasHoggle: 2
|
replicasHoggle: 2
|
||||||
env:
|
env:
|
||||||
approot: "https://stackage.org"
|
approot: "https://stackage.org"
|
||||||
@ -32,3 +32,8 @@ cronResources:
|
|||||||
limits:
|
limits:
|
||||||
cpu: 300m
|
cpu: 300m
|
||||||
memory: 4096Mi
|
memory: 4096Mi
|
||||||
|
|
||||||
|
cron:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
registrySecretName: gitlab-ci-registrykey
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
replicasHoggle: 2
|
replicasHoggle: 1
|
||||||
env:
|
env:
|
||||||
approot: "https://ci.stackage.org"
|
approot: "https://ci.stackage.org"
|
||||||
|
|
||||||
@ -32,3 +32,5 @@ cronResources:
|
|||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
memory: 2096Mi
|
memory: 2096Mi
|
||||||
|
|
||||||
|
registrySecretName: registry-key
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user