Skip to content

Commit

Permalink
allowing airflow ports to be exposed on all network (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro authored Mar 14, 2023
1 parent 0327067 commit 69e5305
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions airflow/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func generateConfig(projectName, airflowHome, envFile, buildImage, settingsFile
AirflowUser: "astro",
AirflowWebserverPort: config.CFG.WebserverPort.GetString(),
AirflowEnvFile: envFile,
AirflowExposePort: config.CFG.AirflowExposePort.GetBool(),
MountLabel: "z",
SettingsFile: settingsFile,
SettingsFileExist: settingsFileExist,
Expand Down
1 change: 1 addition & 0 deletions airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type ComposeConfig struct {
AirflowHome string
AirflowUser string
AirflowWebserverPort string
AirflowExposePort bool
MountLabel string
SettingsFile string
SettingsFileExist bool
Expand Down
8 changes: 8 additions & 0 deletions airflow/include/composeyml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ services:
io.astronomer.docker: "true"
io.astronomer.docker.cli: "true"
ports:
{{- if not .AirflowExposePort }}
- 127.0.0.1:{{ .PostgresPort }}:5432
{{- else }}
- {{ .PostgresPort }}:5432
{{- end }}
volumes:
{{if .DuplicateImageVolumes}}
- postgres_data:/var/lib/postgresql/data
Expand Down Expand Up @@ -92,7 +96,11 @@ services:
- postgres
environment: *common-env-vars
ports:
{{- if not .AirflowExposePort }}
- 127.0.0.1:{{ .AirflowWebserverPort }}:8080
{{- else }}
- {{ .AirflowWebserverPort }}:8080
{{- end }}
volumes:
- {{ .AirflowHome }}/dags:/usr/local/airflow/dags:{{ .MountLabel }}
- {{ .AirflowHome }}/plugins:/usr/local/airflow/plugins:{{ .MountLabel }}
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var (
ProjectName: newCfg("project.name", ""),
ProjectWorkspace: newCfg("project.workspace", ""),
WebserverPort: newCfg("webserver.port", "8080"),
AirflowExposePort: newCfg("airflow.expose_port", "false"),
ShowWarnings: newCfg("show_warnings", "true"),
Verbosity: newCfg("verbosity", "warning"),
HoustonDialTimeout: newCfg("houston.dial_timeout", "10"),
Expand Down
1 change: 1 addition & 0 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type cfgs struct {
ProjectDeployment cfg
ProjectWorkspace cfg
WebserverPort cfg
AirflowExposePort cfg
ShowWarnings cfg
Verbosity cfg
HoustonDialTimeout cfg
Expand Down

0 comments on commit 69e5305

Please sign in to comment.