Commit 96c92649 authored by Thibault Rolland's avatar Thibault Rolland
Browse files

version kustomize

parents
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-deployment
labels:
environment: dev
app: ws-station
spec:
replicas: 1
selector:
matchLabels:
app: ws-station
template: # POD template
metadata:
labels:
app: ws-station
environment: dev
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
name: redis
protocol: TCP
- name: ws-station
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station:dee7c312
imagePullPolicy: Always
resources:
requests:
memory: "512M"
cpu: "500m"
limits:
memory: "700M"
cpu: "1000m"
ports:
- containerPort: 8080
env:
- name: RUNMODE
value: dev
- name: BASEURL
value: wsdev.resif.fr
- name: PGHOST
value: resif-pgpreprod.u-ga.fr
- name: PGPORT
value: "5432"
- name: PGDATABASE
value: resifInv-Preprod
- name: PGUSER
value: wsstation
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: ws-station-dev-secrets
key: wsstation
- name: JAVA_OPTS
value: "-Xmx512m -DwssConfigDir='/home/sysop/wss-config'"
- name: fdsnwsstat
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/fdsnwsstat/fdsnwsstat:a08b331d
resources:
requests:
memory: "100M"
cpu: "100m"
ports:
- containerPort: 8000
env:
- name: STATS_DBURI
valueFrom:
secretKeyRef:
name: ws-station-dev-secrets
key: resifstatsuri
- name: INV_DBURI
valueFrom:
secretKeyRef:
name: ws-station-dev-secrets
key: resifinvuri
- name: AUTH_DBURI
valueFrom:
secretKeyRef:
name: ws-station-dev-secrets
key: resifauthuri
- name: RUNMODE
value: dev
- name: REDIS_QUEUE
value: fdsnwsstat
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ws-station-ingress
labels:
app: ws-station
environment: dev
spec:
rules:
- host: "wsdev.resif.fr"
http:
paths:
- path: /fdsnws/station/1/(.*)
pathType: Prefix
backend:
service:
name: ws-station-service
port:
number: 8080
apiVersion: v1
kind: Service
metadata:
name: ws-station-service
labels:
app: ws-station
environment: dev
spec:
type: ClusterIP
ports:
- port: 8080
selector:
app: ws-station
environment: dev
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-deployment
labels:
environment: preprod
app: ws-station
spec:
replicas: 1
selector:
matchLabels:
app: ws-station
template: # POD template
metadata:
labels:
app: ws-station
environment: preprod
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
name: redis
protocol: TCP
- name: ws-station
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station:dee7c312
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: RUNMODE
value: test
- name: PGHOST
value: resif-pgpreprod.u-ga.fr
- name: PGPORT
value: "5432"
- name: PGDATABASE
value: resifInv-Preprod
- name: PGUSER
value: wsstation
- name: BASEURL
value: wstest.resif.fr
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: ws-station-preprod-secrets
key: wsstation
- name: JAVA_OPTS
value: "-Xmx512m -DwssConfigDir='/home/sysop/wss-config'"
- name: fdsnwsstat
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/fdsnwsstat/fdsnwsstat:a08b331d
ports:
- containerPort: 8000
env:
- name: STATS_DBURI
valueFrom:
secretKeyRef:
name: ws-station-preprod-secrets
key: resifstatsuri
- name: INV_DBURI
valueFrom:
secretKeyRef:
name: ws-station-preprod-secrets
key: resifinvuri
- name: AUTH_DBURI
valueFrom:
secretKeyRef:
name: ws-station-preprod-secrets
key: resifauthuri
- name: RUNMODE
value: test
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ws-station-ingress
labels:
app: ws-station
environment: preprod
spec:
rules:
- http:
paths:
- path: /fdsnws/station/1/(.*)
pathType: Prefix
backend:
service:
name: ws-station-service
port:
number: 8080
apiVersion: v1
kind: Service
metadata:
name: ws-station-service
labels:
app: ws-station
environment: preprod
spec:
type: ClusterIP
ports:
- port: 8080
selector:
app: ws-station
environment: preprod
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-deployment
labels:
environment: production
app: ws-station
spec:
replicas: 3
selector:
matchLabels:
app: ws-station
template: # POD template
metadata:
labels:
app: ws-station
environment: production
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
name: redis
protocol: TCP
- name: ws-station
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station:dee7c312
imagePullPolicy: Always
resources:
requests:
memory: "512M"
cpu: "500m"
limits:
memory: "700M"
cpu: "1000m"
ports:
- containerPort: 8080
env:
- name: RUNMODE
value: production
- name: BASEURL
value: ws.resif.fr
- name: PGHOST
value: resif-pgprod.u-ga.fr
- name: PGPORT
value: "5432"
- name: PGDATABASE
value: resifInv-Preprod
- name: PGUSER
value: wsstation
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: ws-station-production-secrets
key: wsstation
- name: JAVA_OPTS
value: "-Xmx512m -DwssConfigDir='/home/sysop/wss-config'"
- name: fdsnwsstat
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/fdsnwsstat/fdsnwsstat:a08b331d
resources:
requests:
memory: "100M"
cpu: "100m"
ports:
- containerPort: 8000
env:
- name: STATS_DBURI
valueFrom:
secretKeyRef:
name: ws-station-production-secrets
key: resifstatsuri
- name: INV_DBURI
valueFrom:
secretKeyRef:
name: ws-station-production-secrets
key: resifinvuri
- name: AUTH_DBURI
valueFrom:
secretKeyRef:
name: ws-station-production-secrets
key: resifauthuri
- name: RUNMODE
value: production
- name: REDIS_QUEUE
value: fdsnwsstat
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ws-station-ingress
labels:
app: ws-station
environment: production
spec:
rules:
- host: "ws.resif.fr"
http:
paths:
- path: /fdsnws/station/1/(.*)
pathType: Prefix
backend:
service:
name: ws-station-service
port:
number: 8080
apiVersion: v1
kind: Service
metadata:
name: ws-station-service
labels:
app: ws-station
environment: production
spec:
type: ClusterIP
ports:
- port: 8080
selector:
app: ws-station
environment: production
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-2-deployment
spec:
template:
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
name: redis
protocol: TCP
envFrom:
- configMapRef:
name: ws-station-2
- name: ws-station-2
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station
imagePullPolicy: Always
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: ws-station-2
- name: fdsnwsstat
image: gricad-registry.univ-grenoble-alpes.fr/osug/resif/fdsnwsstat/fdsnwsstat
ports:
- containerPort: 8000
envFrom:
- configMapRef:
name: ws-station-2
...
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ws-station-2-ingress
spec:
rules:
- http:
paths:
- pathType: Prefix
path: /fdsnws/station/1/(.*)
backend:
service:
name: ws-station-2-service
port:
number: 8080
...
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml
...
---
apiVersion: v1
kind: Service
metadata:
name: ws-station-2-service
spec:
type: ClusterIP
ports:
- port: 8080
...
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./overlays/staging
- ./overlays/production
...
RUNMODE=dev
# Container redis
# Container ws-station
BASEURL=wsdev.resif.fr
PGHOST=resif-pgpreprod.u-ga.fr
PGPORT="5432"
PGDATABASE=resifInv-Preprod
PGUSER=wsstation
JAVA_OPTS="-Xmx512m -DwssConfigDir='/home/sysop/wss-config'"
# Container fdsnwsstat
REDIS_QUEUE=fdsnwsstat
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: ws-station
context: dev
images:
- name: redis
newTag: latest
- name: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station
newTag: dee7c312
- name: gricad-registry.univ-grenoble-alpes.fr/osug/resif/fdsnwsstat/fdsnwsstat
newTag: a08b331d
namePrefix: dev-
replicas:
- name: ws-station-deployment
count: 1
resources:
- ../../base
configMapGenerator:
- name: ws-station
env: config.properties
patches:
# Ajout de l'hôte ws.resif.fr (prod) / ws-staging.resif.fr (staging)
- target:
kind: Ingress
name: ws-station-ingress
patch: |-
- op: add
path: /spec/rules/0/host
value: "wsdev.resif.fr"
# Ajoute les limites de ressources allouées
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-deployment
spec:
template:
spec:
containers:
- name: ws-station
resources:
requests:
memory: "512M"
cpu: "500m"
limits:
memory: "700M"
cpu: "1000m"
- name: fdsnwsstat
resources:
requests:
memory: "100M"
cpu: "100m"
# Ajout de variables d'environnement
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: ws-station-deployment
spec:
template:
spec:
containers:
- name: ws-station
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: dev-ws-station-secrets
key: wsstation
- name: ws-station
env:
- name: STATS_DBURI
valueFrom:
secretKeyRef:
name: dev-ws-station-secrets
key: resifstatsuri
- name: INV_DBURI
valueFrom:
secretKeyRef:
name: dev-ws-station-secrets
key: resifinvuri
- name: AUTH_DBURI
valueFrom:
secretKeyRef:
name: dev-ws-station-secrets
key: resifauthuri
...
apiVersion: v1
kind: Secret
metadata:
name: dev-ws-station-secrets
labels:
app: ws-station
context: dev
type: Opaque
stringData:
resifinv_ro: ENC[AES256_GCM,data:zfT9WLmqd7QwYJ9bH2cuQg==,iv:rQeMauMbzbKlg+5QE/HAWqAcWFA3WXSQAht5T6JYcvY=,tag:GjD8U2j40r5XdqNvzsVF5A==,type:str]
wsstation: ENC[AES256_GCM,data:lsafzdegL29P2SRu,iv:TFNOHCfxC7ITBA17yb90ca5/9kmqngowRlEeyxsi4U4=,tag:/PKyRWaF4oddOk/pja1siA==,type:str]
resifstatsuri: ENC[AES256_GCM,data:JkkiDSFknVBpyx1/f2YESusasborWPzYw8ubR3mEuedueN8NR0n58FnnJD+JL6OQr9rRpErTc6ZKVusCgDRn5wHO/EZ7kdjN6OeSRA==,iv:K3+eBVJgi8fViP60wJLFDMgUg6z5lWurhSiGfAi96Bg=,tag:gsWBlW64nLvbNUUj58FBhw==,type:str]
resifinvuri: ENC[AES256_GCM,data:BLFY3RfewLDg6EwKDjEb8xTwwrZEWCdonEkY9ycAyUCd3VBqCrhXhTToQG5xvxmH0ybutYWKIXE+xc/LULEgdThFSYraF/yeHUZV3/g7fw==,iv:Q2Y+QDE9a2rNKrtx2JJHKAOUPQcyxU1du1Y5fU+N2Mk=,tag:XLwNeoNDO809bdSfgH77UQ==,type:str]
resifauthuri: ENC[AES256_GCM,data:Dm/73Q/+1F1Sde/6nmLeXlv6cJ3NmcJkqwb5sOZvxTAJPTkEZxB6aUdmYIm4L0qLHiQ5HeBtLn5K5rhowT3vYLFJl3DKzSSWkxK4,iv:s+i5s27M06oJOrwS++8xwQJrnhrbGZfTbtGyafm81Q8=,tag:l/zQLe/xmihAeeQ/K7m/pg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: []
lastmodified: "2022-02-25T15:25:47Z"
mac: ENC[AES256_GCM,data:tmObiHHbiyQVlQoM0Up3IGCUnSRbicha+EYrVp9AuyLek5sB6ZUsL8Rio/DRU9MPjY+8l9CrsUqu6PqzbPuFw/stMVBQZ7IPRenY5Ro6HSv+aTbw583RTAWIvD+A7pZ4ALEcDYTgSUjb/jjrXHAXVSgNSoe11+CQosOtuQP45Tk=,iv:UGrdvsKc1vbovt9MD0yorhwe9IE3LVJDRmv+tjCBtJM=,tag:i0S7s5tbwQnLrwNSEpanog==,type:str]
pgp:
- created_at: "2020-06-19T14:00:02Z"
enc: |
-----BEGIN PGP MESSAGE-----
hQEMA23uPS/3Y9M2AQgAjx0vTXHspE9LneeGi/ev/xk0A8yi3DxgJsZVtEsbSQwL
5ZijJ0wI/p0y2HzPlhl+w9INKcMQUxGo2Z184AIEwWFL8TbN97x700xiAV2gLTSq
yapwXwGloZZMCV6oWmktTA3IPeeLmGHpaR4lY4IR8iBAJophG9tc8C73xRQTzWec
ev3C+wtLnTlxpUhZj2foZ7B2ARAlE2LWqT2I3wp7d1ZJYmSrdJpltarMaJiw18X8
lpmJ/SmTO8ITRrPvtxZfBBlzNAAjbC0ed8Qs3RUHa1PSh/VeiOnefkz0lBQNKxvZ
JknwRw2AsGW0KirSLk9av7djUmasbf6mj+n8Tvi2J9JeAU4eCVRTc/AP+UFq5Ynn
yi79EnUAbM+19apxYkYQME4i2FrhnUtlcdrRNvwIBz1DOa12Z/8W7gdrpwFlM9mK
CjptN6pgRXNnV7yegPX8cJCGaoWB+TPpKheAwE3CMQ==
=CH3Z
-----END PGP MESSAGE-----
fp: C83ECA1E0B9D719C7FA2470F18E4F5A58801E669
encrypted_regex: ^(data|stringData)$
version: 3.7.1
RUNMODE=production
# Container redis
# Container ws-station
BASEURL=ws.resif.fr
PGHOST=resif-pgprod.u-ga.fr
PGPORT="5432"
PGDATABASE=resifInv-Preprod
PGUSER=wsstation
JAVA_OPTS="-Xmx512m -DwssConfigDir='/home/sysop/wss-config'"
# Container fdsnwsstat
REDIS_QUEUE=fdsnwsstat
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: ws-station
context: production
images:
- name: redis
newTag: latest
- name: gricad-registry.univ-grenoble-alpes.fr/osug/resif/ws-station/ws-station