File tree Expand file tree Collapse file tree 4 files changed +74
-0
lines changed Expand file tree Collapse file tree 4 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 7272{{- if .AzureWorkloadIdentity }}
7373 podLabels:
7474 azure.workload.identity/use: "true"
75+ {{- end }}
7576{{- if .ServiceAccountName }}
7677 serviceAccountName: {{ .ServiceAccountName }}
7778{{- end }}
Original file line number Diff line number Diff line change @@ -65,6 +65,32 @@ func TestScaffoldOutput(t *testing.T) {
6565 },
6666 expected : "multiple_image_secrets.yml" ,
6767 },
68+ {
69+ name : "service account name is provided" ,
70+ opts : ScaffoldOptions {
71+ from : "ghcr.io/foo/example-app:v0.1.0" ,
72+ replicas : 2 ,
73+ executor : "containerd-shim-spin" ,
74+ serviceAccountName : "my-service-account" ,
75+ },
76+ expected : "service_account_name.yml" ,
77+ },
78+ {
79+ name : "service account with HPA autoscaler" ,
80+ opts : ScaffoldOptions {
81+ from : "ghcr.io/foo/example-app:v0.1.0" ,
82+ executor : "containerd-shim-spin" ,
83+ autoscaler : "hpa" ,
84+ cpuLimit : "100m" ,
85+ memoryLimit : "128Mi" ,
86+ replicas : 2 ,
87+ maxReplicas : 3 ,
88+ targetCPUUtilizationPercentage : 60 ,
89+ targetMemoryUtilizationPercentage : 60 ,
90+ serviceAccountName : "my-service-account" ,
91+ },
92+ expected : "hpa_service_account.yml" ,
93+ },
6894 {
6995 name : "HPA autoscaler support" ,
7096 opts : ScaffoldOptions {
Original file line number Diff line number Diff line change 1+ apiVersion : core.spinkube.dev/v1alpha1
2+ kind : SpinApp
3+ metadata :
4+ name : example-app
5+ spec :
6+ image : " ghcr.io/foo/example-app:v0.1.0"
7+ executor : containerd-shim-spin
8+ enableAutoscaling : true
9+ serviceAccountName : my-service-account
10+ resources :
11+ limits :
12+ cpu : 100m
13+ memory : 128Mi
14+ ---
15+ apiVersion : autoscaling/v2
16+ kind : HorizontalPodAutoscaler
17+ metadata :
18+ name : example-app-autoscaler
19+ spec :
20+ scaleTargetRef :
21+ apiVersion : apps/v1
22+ kind : Deployment
23+ name : example-app
24+ minReplicas : 2
25+ maxReplicas : 3
26+ metrics :
27+ - type : Resource
28+ resource :
29+ name : cpu
30+ target :
31+ type : Utilization
32+ averageUtilization : 60
33+ - type : Resource
34+ resource :
35+ name : memory
36+ target :
37+ type : Utilization
38+ averageUtilization : 60
Original file line number Diff line number Diff line change 1+ apiVersion : core.spinkube.dev/v1alpha1
2+ kind : SpinApp
3+ metadata :
4+ name : example-app
5+ spec :
6+ image : " ghcr.io/foo/example-app:v0.1.0"
7+ executor : containerd-shim-spin
8+ replicas : 2
9+ serviceAccountName : my-service-account
You can’t perform that action at this time.
0 commit comments