Skip to content

Commit a3aeb28

Browse files
authored
Merge pull request #569 from chengshifan/add-allow-ip-for-svc-gcp
[INT] add allow ip to access service-gcp
2 parents 5723a18 + d81b688 commit a3aeb28

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

deploy/infrabox/templates/scheduler/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
memory: "400Mi"
3030
limits:
3131
cpu: "500m"
32-
memory: "2Gi"
32+
memory: "4Gi"
3333
env:
3434
{{ include "env_database" . | indent 16 }}
3535
{{ include "env_general" . | indent 16 }}

src/services/gcp/infrabox-service-gcp/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ spec:
4848
value: {{ .Values.max_clusters | quote }}
4949
- name: LOG_LEVEL
5050
value: {{ .Values.log_level | quote }}
51+
- name: ALLOW_IPS
52+
value: {{ .Values.allow_ips | quote }}
5153
- name: GC_ENABLED
5254
value: {{ .Values.gc_enabled | quote }}
5355
{{ if .Values.gc_enabled }}

src/services/gcp/infrabox-service-gcp/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ gc_interval: 3600
2121

2222
# info | debug | warn | error
2323
log_level: info
24+
25+
allow_ips:

src/services/gcp/pkg/stub/handler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ func createCluster(cr *v1alpha1.GKECluster, log *logrus.Entry) (*v1alpha1.GKEClu
223223
args = append(args, "--enable-private-nodes")
224224
args = append(args, "--master-ipv4-cidr", finalCIDR)
225225
args = append(args, "--enable-master-authorized-networks")
226-
args = append(args, "--master-authorized-networks", "0.0.0.0/0")
226+
master_authorized_networks := os.Getenv("ALLOW_IPS")
227+
if master_authorized_networks == "" {
228+
master_authorized_networks = "0.0.0.0/0"
229+
}
230+
args = append(args, "--master-authorized-networks", master_authorized_networks)
227231
cmd := exec.Command("gcloud" , args...)
228232
out, err := cmd.CombinedOutput()
229233

0 commit comments

Comments
 (0)