Skip to content
Snippets Groups Projects
Commit 2e174a44 authored by François  LAURENT's avatar François LAURENT
Browse files

Merge branch 'dev' into 'main'

deployment to prod

See merge request !3
parents 6747f04e 9d451958
No related branches found
No related tags found
2 merge requests!4update dev,!3deployment to prod
Pipeline #148134 passed
variables: variables:
GITLAB_PASTEUR_PROJECT_ID: 6531 GITLAB_PASTEUR_PROJECT_ID: 6531
PROJECT_NAME: nyxui
stages: stages:
- build - build
...@@ -72,20 +73,27 @@ build dev on gitlab.pasteur.fr: ...@@ -72,20 +73,27 @@ build dev on gitlab.pasteur.fr:
--docker-email=kubernetes@pasteur.fr --docker-email=kubernetes@pasteur.fr
--dry-run=client --dry-run=client
-n "$NAMESPACE" -o yaml | kubectl apply -f - -n "$NAMESPACE" -o yaml | kubectl apply -f -
- cd $CI_PROJECT_DIR/nyxui # - cd $CI_PROJECT_DIR/nyxui
- helm upgrade --install --debug nyxui . --namespace="$NAMESPACE" - helmfile lint
--set front.image.tag=$CI_COMMIT_SHORT_SHA - helmfile template
--set ingress.hosts[0].host="$PUBLIC_URL" - helmfile sync
--set ingress.hosts[0].paths[0].path="/"
--set ingress.hosts[0].paths[0].pathType="Prefix"
rules: rules:
- if: $CI_PROJECT_ID == $GITLAB_PASTEUR_PROJECT_ID # gitlab.pasteur.fr only - if: $CI_PROJECT_ID == $GITLAB_PASTEUR_PROJECT_ID # gitlab.pasteur.fr only
deploy to pasteur.cloud: deploy to pasteur.cloud:
extends: .deploy-with-manifests extends: .deploy-with-helm
variables: variables:
NAMESPACE: "nyx-prod" IMAGE_URL: "registry-gitlab.pasteur.fr/nyx/nyxui.jl/front"
SERVICE_TARGET_PORT: "8080"
IMAGE_SECRETS: "registry-gitlab"
KUBE_NAMESPACE: "nyx-prod"
PUBLIC_URL: "nyx.pasteur.cloud" PUBLIC_URL: "nyx.pasteur.cloud"
INGRESS_CLASS: "internal"
INGRESS_URL: "nyx.pasteur.cloud"
SERVICE_PORT: "80"
LIMITS_CPU: "2"
LIMITS_MEMORY: "4Gi"
LIMITS_STORAGE: "1Gi"
environment: environment:
name: k8sprod-02/nyx-prod name: k8sprod-02/nyx-prod
url: https://nyx.pasteur.cloud url: https://nyx.pasteur.cloud
...@@ -94,13 +102,23 @@ deploy to pasteur.cloud: ...@@ -94,13 +102,23 @@ deploy to pasteur.cloud:
when: manual when: manual
deploy to dev.pasteur.cloud: deploy to dev.pasteur.cloud:
extends: .deploy-with-manifests extends: .deploy-with-helm
variables: variables:
NAMESPACE: "nyx-dev" IMAGE_URL: "registry-gitlab.pasteur.fr/nyx/nyxui.jl/front"
SERVICE_TARGET_PORT: "8080"
IMAGE_SECRETS: "registry-gitlab"
KUBE_NAMESPACE: "nyx-dev"
PUBLIC_URL: "nyx.dev.pasteur.cloud" PUBLIC_URL: "nyx.dev.pasteur.cloud"
INGRESS_CLASS: "internal"
INGRESS_URL: "nyx.dev.pasteur.cloud"
SERVICE_PORT: "80"
LIMITS_CPU: "2"
LIMITS_MEMORY: "4Gi"
LIMITS_STORAGE: "1Gi"
environment: environment:
name: k8sdev-01/nyx-dev name: k8sdev-01/nyx-dev
url: https://nyx.dev.pasteur.cloud url: https://nyx.dev.pasteur.cloud
rules: rules:
- if: $CI_COMMIT_BRANCH == "dev" - if: $CI_COMMIT_BRANCH == "dev"
when: manual
...@@ -27,9 +27,9 @@ version = "0.1.9" ...@@ -27,9 +27,9 @@ version = "0.1.9"
[[deps.Bonito]] [[deps.Bonito]]
deps = ["Base64", "CodecZlib", "Colors", "Dates", "Deno_jll", "HTTP", "Hyperscript", "LinearAlgebra", "Markdown", "MsgPack", "Observables", "RelocatableFolders", "SHA", "Sockets", "Tables", "ThreadPools", "URIs", "UUIDs", "WidgetsBase"] deps = ["Base64", "CodecZlib", "Colors", "Dates", "Deno_jll", "HTTP", "Hyperscript", "LinearAlgebra", "Markdown", "MsgPack", "Observables", "RelocatableFolders", "SHA", "Sockets", "Tables", "ThreadPools", "URIs", "UUIDs", "WidgetsBase"]
git-tree-sha1 = "262f58917d5d9644d16ec6f53480e11a6e128db2" git-tree-sha1 = "534820940e4359c09adc615f8bd06ca90d508ba6"
uuid = "824d6782-a2ef-11e9-3a09-e5662e0c26f8" uuid = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
version = "4.0.0" version = "4.0.1"
[[deps.CSTParser]] [[deps.CSTParser]]
deps = ["Tokenize"] deps = ["Tokenize"]
...@@ -438,11 +438,11 @@ version = "1.0.0" ...@@ -438,11 +438,11 @@ version = "1.0.0"
[[deps.NyxPlots]] [[deps.NyxPlots]]
deps = ["Bonito", "Observables", "PlotlyBase"] deps = ["Bonito", "Observables", "PlotlyBase"]
git-tree-sha1 = "08f7db5d9fe0d084773c96b15ac0ef69f2b6e283" git-tree-sha1 = "3d54e1c527baaf6a003e0d7a4fce5fcb9d3dd775"
repo-rev = "main" repo-rev = "main"
repo-url = "https://gitlab.com/dbc-nyx/NyxPlots.jl" repo-url = "https://gitlab.com/dbc-nyx/NyxPlots.jl"
uuid = "e8b8ccdb-0776-4145-b74f-57bbbfff4409" uuid = "e8b8ccdb-0776-4145-b74f-57bbbfff4409"
version = "0.1.1" version = "0.1.2"
[[deps.NyxWidgets]] [[deps.NyxWidgets]]
deps = ["Bonito", "Colors", "Format", "LazyArtifacts", "Observables"] deps = ["Bonito", "Colors", "Format", "LazyArtifacts", "Observables"]
......
helmDefaults:
createNamespace: false
releases:
- name: nyxui
chart: ./nyxui
namespace: {{ requiredEnv "KUBE_NAMESPACE" }}
installed: true
values:
- ./values-yaml.gotmpl
...@@ -18,6 +18,15 @@ spec: ...@@ -18,6 +18,15 @@ spec:
containers: containers:
- name: $APP_NAME - name: $APP_NAME
image: $FQ_IMAGE_NAME image: $FQ_IMAGE_NAME
resources:
limits:
cpu: "2"
ephemeral-storage: 1Gi
memory: 4Gi
requests:
cpu: "2"
ephemeral-storage: 1Gi
memory: 4Gi
ports: ports:
- name: http - name: http
containerPort: 8080 containerPort: 8080
...@@ -26,4 +35,4 @@ spec: ...@@ -26,4 +35,4 @@ spec:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
capabilities: capabilities:
drop: drop:
- ALL - ALL
\ No newline at end of file
...@@ -55,7 +55,7 @@ Create the name of the service account to use ...@@ -55,7 +55,7 @@ Create the name of the service account to use
*/}} */}}
{{- define "nyxui.serviceAccountName" -}} {{- define "nyxui.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }} {{- if .Values.serviceAccount.create }}
{{- default (include "nyxui.fullname" .) .Values.serviceAccount.name }} {{- default (include "nyxui.name" .) .Values.serviceAccount.name }}
{{- else }} {{- else }}
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}
......
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "nyxui.fullname" . }} name: {{ include "nyxui.name" . }}
labels: labels:
{{- include "nyxui.labels" . | nindent 4 }} {{- include "nyxui.labels" . | nindent 4 }}
spec: spec:
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
apiVersion: autoscaling/v2 apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: {{ include "nyxui.fullname" . }} name: {{ include "nyxui.name" . }}
labels: labels:
{{- include "nyxui.labels" . | nindent 4 }} {{- include "nyxui.labels" . | nindent 4 }}
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: {{ include "nyxui.fullname" . }} name: {{ include "nyxui.name" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }} minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics: metrics:
......
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "nyxui.fullname" . -}} {{- $fullName := include "nyxui.name" . -}}
{{- $svcPort := .Values.service.port -}} {{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
...@@ -15,9 +15,9 @@ apiVersion: extensions/v1beta1 ...@@ -15,9 +15,9 @@ apiVersion: extensions/v1beta1
{{- end }} {{- end }}
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ .Values.ingress.name }}
labels: labels:
{{- include "nyxui.labels" . | nindent 4 }} app: {{ .Values.ingress.name }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
...@@ -49,11 +49,11 @@ spec: ...@@ -49,11 +49,11 @@ spec:
backend: backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service: service:
name: {{ $fullName }} name: {{ $fullName }}-front
port: port:
number: {{ $svcPort }} number: {{ $svcPort }}
{{- else }} {{- else }}
serviceName: {{ $fullName }} serviceName: {{ $fullName }}-front
servicePort: {{ $svcPort }} servicePort: {{ $svcPort }}
{{- end }} {{- end }}
{{- end }} {{- end }}
......
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "nyxui.fullname" . }} name: {{ include "nyxui.name" . }}
labels: labels:
{{- include "nyxui.labels" . | nindent 4 }} {{- include "nyxui.labels" . | nindent 4 }}
spec: spec:
......
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: "{{ include "nyxui.fullname" . }}-test-connection" name: "{{ include "nyxui.name" . }}-test-connection"
labels: labels:
{{- include "nyxui.labels" . | nindent 4 }} {{- include "nyxui.labels" . | nindent 4 }}
annotations: annotations:
...@@ -11,5 +11,5 @@ spec: ...@@ -11,5 +11,5 @@ spec:
- name: wget - name: wget
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['{{ include "nyxui.fullname" . }}:{{ .Values.service.port }}'] args: ['{{ include "nyxui.name" . }}:{{ .Values.service.port }}']
restartPolicy: Never restartPolicy: Never
...@@ -49,12 +49,14 @@ service: ...@@ -49,12 +49,14 @@ service:
ingress: ingress:
enabled: true enabled: true
className: "" className: internal
name: nyxui
annotations: annotations:
kubernetes.io/ingress.class: internal meta.helm.sh/release-name: nyxui
# kubernetes.io/tls-acme: "true" meta.helm.sh/release-namespace: nyxui-dev
nginx.ingress.kubernetes.io/proxy-body-size: "0"
hosts: hosts:
- host: nyx.pasteur.cloud - host: nyx.dev.pasteur.cloud
paths: paths:
- path: / - path: /
pathType: Prefix pathType: Prefix
...@@ -63,17 +65,15 @@ ingress: ...@@ -63,17 +65,15 @@ ingress:
# hosts: # hosts:
# - chart-example.local # - chart-example.local
resources: {} resources:
# We usually recommend not to specify default resources and to leave this as a conscious limits:
# choice for the user. This also increases chances charts run on environments with little cpu: "2"
# resources, such as Minikube. If you do want to specify resources, uncomment the following memory: 4Gi
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. ephemeral-storage: 1Gi
# limits: requests:
# cpu: 100m cpu: "2"
# memory: 128Mi memory: 4Gi
# requests: ephemeral-storage: 1Gi
# cpu: 100m
# memory: 128Mi
autoscaling: autoscaling:
enabled: false enabled: false
......
# Default values for nyxui.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
front:
image:
repository: {{ requiredEnv "IMAGE_URL" }}
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
service:
targetPort: {{ requiredEnv "SERVICE_TARGET_PORT" }}
imagePullSecrets:
- name: {{ requiredEnv "IMAGE_SECRETS" }}
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podLabels: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: {{ requiredEnv "SERVICE_PORT" }}
ingress:
enabled: true
name: nyxui
className: {{ requiredEnv "INGRESS_CLASS" }}
annotations:
meta.helm.sh/release-name: {{ requiredEnv "INGRESS_CLASS" }}
meta.helm.sh/release-namespace: {{ requiredEnv "KUBE_NAMESPACE" }}
nginx.ingress.kubernetes.io/proxy-body-size: "0"
hosts:
- host: {{ requiredEnv "INGRESS_URL" }}
paths:
- path: /
pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources:
limits:
cpu: {{ requiredEnv "LIMITS_CPU" }}
memory: {{ requiredEnv "LIMITS_MEMORY" }}
ephemeral-storage: {{ requiredEnv "LIMITS_STORAGE" }}
requests:
cpu: {{ requiredEnv "LIMITS_CPU" }}
memory: {{ requiredEnv "LIMITS_MEMORY" }}
ephemeral-storage: {{ requiredEnv "LIMITS_STORAGE" }}
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 1
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false
# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
nodeSelector: {}
tolerations: []
affinity: {}
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