Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 4c88b76

Browse files
Allow setting Kiam version <3.0 (#1599)
Update Kiam template and defaults. Change default sessontimeout to 30m by default so that Kiam does some caching. Update tests with 30m session caching
1 parent ffaec1f commit 4c88b76

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

builtin/files/cluster.yaml.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,14 +1467,14 @@ experimental:
14671467
# This is intended to be used in combination with .controller.iam.role.name. See #297 for more information.
14681468
kiamSupport:
14691469
enabled: false
1470-
image:
1471-
repo: quay.io/uswitch/kiam
1472-
tag: v2.8
1473-
rktPullDocker: false
1474-
sessionDuration: 15m
1475-
serverAddresses:
1476-
serverAddress: localhost:443
1477-
agentAddress: kiam-server:443
1470+
# image:
1471+
# repo: quay.io/uswitch/kiam
1472+
# tag: v3.2
1473+
# rktPullDocker: false
1474+
# sessionDuration: 30m
1475+
# serverAddresses:
1476+
# serverAddress: localhost:443
1477+
# agentAddress: kiam-server:443
14781478
# Optional resource change for kiam servers/agents can be done via using the resources block below and changing the values.
14791479
# Values below are the default if not set.
14801480
# serverResources:

builtin/files/userdata/cloud-config-controller

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,9 +5549,11 @@ write_files:
55495549
- name: kiam
55505550
image: {{.Experimental.KIAMSupport.Image.RepoWithTag}}
55515551
command:
5552-
- /kiam
5552+
- {{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag}}/kiam{{else}}/server{{end}}
55535553
args:
5554+
{{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag -}}
55545555
- server
5556+
{{ end -}}
55555557
- --json-log
55565558
- --bind=0.0.0.0:443
55575559
- --cert=/etc/kiam/tls/server.pem
@@ -5570,27 +5572,37 @@ write_files:
55705572
livenessProbe:
55715573
exec:
55725574
command:
5575+
{{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag -}}
55735576
- /kiam
55745577
- health
5578+
- --gateway-timeout-creation=1s
5579+
{{ else -}}
5580+
- /health
5581+
- --server-address-refresh=2s
5582+
{{ end -}}
55755583
- --cert=/etc/kiam/tls/server.pem
55765584
- --key=/etc/kiam/tls/server-key.pem
55775585
- --ca=/etc/kiam/tls/ca.pem
55785586
- --server-address={{.Experimental.KIAMSupport.ServerAddresses.ServerAddress}}
5579-
- --gateway-timeout-creation=1s
55805587
- --timeout=5s
55815588
initialDelaySeconds: 10
55825589
periodSeconds: 10
55835590
timeoutSeconds: 10
55845591
readinessProbe:
55855592
exec:
55865593
command:
5594+
{{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag -}}
55875595
- /kiam
55885596
- health
5597+
- --gateway-timeout-creation=1s
5598+
{{ else -}}
5599+
- /health
5600+
- --server-address-refresh=2s
5601+
{{ end -}}
55895602
- --cert=/etc/kiam/tls/server.pem
55905603
- --key=/etc/kiam/tls/server-key.pem
55915604
- --ca=/etc/kiam/tls/ca.pem
55925605
- --server-address={{.Experimental.KIAMSupport.ServerAddresses.ServerAddress}}
5593-
- --gateway-timeout-creation=1s
55945606
- --timeout=5s
55955607
initialDelaySeconds: 3
55965608
periodSeconds: 10
@@ -5733,9 +5745,13 @@ write_files:
57335745
add: ["NET_ADMIN"]
57345746
image: {{.Experimental.KIAMSupport.Image.RepoWithTag}}
57355747
command:
5736-
- /kiam
5748+
- {{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag}}/kiam{{else}}/agent{{end}}
57375749
args:
5750+
{{if checkVersion ">= 3.0" .Experimental.KIAMSupport.Image.Tag -}}
57385751
- agent
5752+
- --whitelist-route-regexp=.*
5753+
- --gateway-timeout-creation=1s
5754+
{{ end -}}
57395755
- --iptables
57405756
{{- if .Kubernetes.Networking.AmazonVPC.Enabled }}
57415757
- --host-interface=!eni0
@@ -5750,10 +5766,8 @@ write_files:
57505766
- --key=/etc/kiam/tls/agent-key.pem
57515767
- --ca=/etc/kiam/tls/ca.pem
57525768
- --server-address={{.Experimental.KIAMSupport.ServerAddresses.AgentAddress}}
5753-
- --whitelist-route-regexp=.*
57545769
- --prometheus-listen-addr=0.0.0.0:9620
57555770
- --prometheus-sync-interval=5s
5756-
- --gateway-timeout-creation=1s
57575771
env:
57585772
- name: HOST_IP
57595773
valueFrom:

pkg/api/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func NewDefaultCluster() *Cluster {
7676
KIAMSupport: KIAMSupport{
7777
Enabled: false,
7878
Image: Image{Repo: "quay.io/uswitch/kiam", Tag: "v3.2", RktPullDocker: false},
79-
SessionDuration: "15m",
79+
SessionDuration: "30m",
8080
ServerAddresses: KIAMServerAddresses{ServerAddress: "localhost:443", AgentAddress: "kiam-server:443"},
8181
},
8282
Kube2IamSupport: Kube2IamSupport{

test/integration/maincluster_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestMainClusterConfig(t *testing.T) {
118118
KIAMSupport: api.KIAMSupport{
119119
Enabled: false,
120120
Image: api.Image{Repo: "quay.io/uswitch/kiam", Tag: "v3.2", RktPullDocker: false},
121-
SessionDuration: "15m",
121+
SessionDuration: "30m",
122122
ServerAddresses: api.KIAMServerAddresses{ServerAddress: "localhost:443", AgentAddress: "kiam-server:443"},
123123
},
124124
Kube2IamSupport: api.Kube2IamSupport{
@@ -1383,7 +1383,7 @@ worker:
13831383
KIAMSupport: api.KIAMSupport{
13841384
Enabled: false,
13851385
Image: api.Image{Repo: "quay.io/uswitch/kiam", Tag: "v3.2", RktPullDocker: false},
1386-
SessionDuration: "15m",
1386+
SessionDuration: "30m",
13871387
ServerAddresses: api.KIAMServerAddresses{ServerAddress: "localhost:443", AgentAddress: "kiam-server:443"},
13881388
},
13891389
Kube2IamSupport: api.Kube2IamSupport{
@@ -1556,8 +1556,8 @@ experimental:
15561556
tag: v2.6
15571557
sessionDuration: 30m
15581558
serverAddresses:
1559-
serverAddress: localhost
1560-
agentAddress: kiam-server
1559+
serverAddress: localhost:443
1560+
agentAddress: kiam-server:443
15611561
worker:
15621562
nodePools:
15631563
- name: pool1
@@ -1568,7 +1568,7 @@ worker:
15681568
Enabled: true,
15691569
Image: api.Image{Repo: "quay.io/uswitch/kiam", Tag: "v2.6", RktPullDocker: false},
15701570
SessionDuration: "30m",
1571-
ServerAddresses: api.KIAMServerAddresses{ServerAddress: "localhost", AgentAddress: "kiam-server"},
1571+
ServerAddresses: api.KIAMServerAddresses{ServerAddress: "localhost:443", AgentAddress: "kiam-server:443"},
15721572
}
15731573

15741574
actual := c.Experimental
@@ -1599,7 +1599,7 @@ worker:
15991599
KIAMSupport: api.KIAMSupport{
16001600
Enabled: true,
16011601
Image: api.Image{Repo: "quay.io/uswitch/kiam", Tag: "v3.2", RktPullDocker: false},
1602-
SessionDuration: "15m",
1602+
SessionDuration: "30m",
16031603
ServerAddresses: api.KIAMServerAddresses{ServerAddress: "localhost:443", AgentAddress: "kiam-server:443"},
16041604
},
16051605
}

0 commit comments

Comments
 (0)