Commit 74d73a02 authored by Jørn Åne de Jong's avatar Jørn Åne de Jong
Browse files

Try re-importing hello-world so we get builds for branches

parent 98dfdf1e
Pipeline #31782 failed with stages
in 49 seconds
image: registry.uninett.no/asm/kubernetes-deploy:v0.22 include:
- project: 'asm/gitlab-ci-helpers'
file: '/gitlab-ci-helpers.yml'
variables: variables:
KUBE_PROD_DOMAIN: cat_eduroam_no.paas2.uninett.no
KUBE_TEST_ID: cat
HTTP_PORT: '80' # The port number of the web server. HTTP_PORT: '80' # The port number of the web server.
REPLICAS: '2' REPLICAS: '1'
stages: stages:
- build - build
- test
- review
- staging - staging
- production - production
build: build:
variables: extends: .docker-build
GIT_SUBMODULE_STRATEGY: recursive
stage: build stage: build
script: only:
- build - branches
imagescan:
extends: .imagescan
stage: test
only: only:
- branches - branches
production: production:
extends: .production
stage: production stage: production
variables: variables:
CI_ENVIRONMENT_URL: $KUBE_PROD_URL REPLICAS: "2"
script: script:
- deploy kubernetes.yaml - deploy deployment.yaml
environment:
name: production
url: $KUBE_PROD_URL
when: manual
only:
- master
staging: staging:
extends: .staging
stage: staging stage: staging
variables:
CI_ENVIRONMENT_URL: $KUBE_STAGING_URL
REPLICAS: '1'
script: script:
- deploy kubernetes.yaml - deploy deployment.yaml
environment:
name: staging review:
url: $KUBE_STAGING_URL extends: .review
only: stage: review
- master script:
- deploy deployment.yaml
stop_review:
extends: .stop_review
stage: review
...@@ -3,6 +3,9 @@ kind: Deployment ...@@ -3,6 +3,9 @@ kind: Deployment
metadata: metadata:
name: $CI_ENVIRONMENT_SLUG name: $CI_ENVIRONMENT_SLUG
namespace: $KUBE_NAMESPACE namespace: $KUBE_NAMESPACE
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels: labels:
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID" pipeline_id: "$CI_PIPELINE_ID"
...@@ -14,6 +17,9 @@ spec: ...@@ -14,6 +17,9 @@ spec:
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
template: template:
metadata: metadata:
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels: labels:
name: $CI_ENVIRONMENT_SLUG name: $CI_ENVIRONMENT_SLUG
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
...@@ -21,12 +27,6 @@ spec: ...@@ -21,12 +27,6 @@ spec:
containers: containers:
- name: app - name: app
image: $CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG image: $CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG
imagePullPolicy: Always
resources:
limits:
memory: 500Mi
requests:
memory: 300Mi
ports: ports:
- name: web - name: web
containerPort: $HTTP_PORT containerPort: $HTTP_PORT
...@@ -42,3 +42,16 @@ spec: ...@@ -42,3 +42,16 @@ spec:
port: $HTTP_PORT port: $HTTP_PORT
initialDelaySeconds: 5 initialDelaySeconds: 5
timeoutSeconds: 15 timeoutSeconds: 15
lifecycle:
preStop: # Give ingress container time to stop sending requests to this container during shutdown.
exec:
command: ['/bin/sleep', '15']
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
name: $CI_ENVIRONMENT_SLUG
topologyKey: failure-domain.beta.kubernetes.io/zone
weight: 10
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment