File tree 6 files changed +26
-23
lines changed
6 files changed +26
-23
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,17 @@ jobs:
37
37
CLUSTER : ${{ inputs.cluster }}
38
38
RESOURCE : .nais/redis.yml
39
39
VARS : .nais/vars/${{ inputs.vars_file }}
40
- - name : Set HPA resource if specified
40
+ - name : Deploy HPA
41
41
if : ${{ inputs.hpa_file }}
42
- run : |
43
- echo "HPA_RESOURCE=,.nais/hpa/${{inputs.hpa_file}}" >> $GITHUB_ENV
44
- - name : Deploy to nais
45
42
uses : nais/deploy/actions/deploy@v2
46
43
env :
47
44
CLUSTER : ${{ inputs.cluster }}
48
- RESOURCE : .nais/${{ inputs.config_file }}${{env.HPA_RESOURCE}}
45
+ RESOURCE : .nais/hpa/${{inputs.hpa_file}}
46
+ VARS : .nais/vars/${{ inputs.vars_file }}
47
+ - name : Deploy application
48
+ uses : nais/deploy/actions/deploy@v2
49
+ env :
50
+ CLUSTER : ${{ inputs.cluster }}
51
+ RESOURCE : .nais/${{ inputs.config_file }}
49
52
VAR : image=${{ inputs.image }}
50
53
VARS : .nais/vars/${{ inputs.vars_file }}
Original file line number Diff line number Diff line change @@ -27,10 +27,12 @@ spec:
27
27
prometheus :
28
28
enabled : true
29
29
path : /internal/metrics
30
- redis :
31
- - instance : {{ redisInstance }}
32
- access : readwrite
33
30
leaderElection : true
31
+ {{#with redis}}
32
+ redis :
33
+ - instance : {{ instance }}
34
+ access : readwrite
35
+ {{/with}}
34
36
ingresses :
35
37
{{#each ingresses as |url|}}
36
38
- {{url}}
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ metadata:
4
4
labels :
5
5
app : nav-enonicxp-frontend
6
6
team : personbruker
7
- name : redis-personbruker-{{ redisInstance }}
7
+ name : redis-personbruker-{{ redis.instance }}
8
8
namespace : personbruker
9
9
spec :
10
- plan : {{ redisPlan }}
11
- project : {{ redisProject }}
10
+ plan : {{ redis.plan }}
11
+ project : {{ redis.project }}
Original file line number Diff line number Diff line change @@ -15,4 +15,8 @@ resources:
15
15
memory : 2500Mi
16
16
replicas :
17
17
min : 3
18
- max : 3
18
+ max : 3
19
+ redis :
20
+ plan : startup-4
21
+ project : nav-prod
22
+ instance : pagecache
Original file line number Diff line number Diff line change @@ -14,11 +14,6 @@ const clientOptions: { [key in AppEnv]?: RedisClientOptions } = {
14
14
username : process . env . REDIS_USERNAME_PAGECACHE_DEV1 ,
15
15
password : process . env . REDIS_PASSWORD_PAGECACHE_DEV1 ,
16
16
} ,
17
- dev2 : {
18
- url : process . env . REDIS_URI_PAGECACHE_DEV2 ,
19
- username : process . env . REDIS_USERNAME_PAGECACHE_DEV2 ,
20
- password : process . env . REDIS_PASSWORD_PAGECACHE_DEV2 ,
21
- } ,
22
17
prod : {
23
18
url : process . env . REDIS_URI_PAGECACHE ,
24
19
username : process . env . REDIS_USERNAME_PAGECACHE ,
Original file line number Diff line number Diff line change @@ -12,14 +12,13 @@ export const isLeaderPod = async (): Promise<boolean> => {
12
12
if ( res . ok ) {
13
13
return res . json ( ) ;
14
14
}
15
+ console . error (
16
+ `Error fetching leader, assuming I'm leader - ${ res . status } ${ res . statusText } `
17
+ ) ;
18
+ return true ;
15
19
} )
16
20
. then ( ( json ) => {
17
- const hostname = os . hostname ( ) ;
18
- console . log (
19
- `Leader election result, comparing with my hostname: ${ hostname } ` ,
20
- json
21
- ) ;
22
- return json . name === hostname ;
21
+ return json . name === os . hostname ( ) ;
23
22
} )
24
23
. catch ( ( e ) => {
25
24
console . error (
You can’t perform that action at this time.
0 commit comments