Skip to content

Commit 7de4777

Browse files
authored
Merge pull request #67 from bgraef/main
add code for olam with haproxy
2 parents 79fa4ab + 962f75f commit 7de4777

File tree

3 files changed

+53
-51
lines changed

3 files changed

+53
-51
lines changed

olam/default_vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ add_pah_ports: false
2929
use_freeipa: false
3030
use_git: false
3131
add_cluster_ports: false
32+
use_haproxy: false
33+
add_haproxy_ports: false
3234

3335
use_kvm: false
3436
create_vm: false

olam/templates/ingress_security_rules.j2

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,30 @@ instance_ingress_security_rules:
7979
destination_port_range:
8080
max: 27199
8181
min: 27199
82-
{% endif %}
82+
{% endif %}
83+
{% if add_haproxy_ports %}
84+
- source: "10.0.0.0/24"
85+
protocol: 6
86+
tcp_options:
87+
destination_port_range:
88+
max: 80
89+
min: 80
90+
- source: "10.0.0.0/24"
91+
protocol: 6
92+
tcp_options:
93+
destination_port_range:
94+
max: 443
95+
min: 443
96+
- source: "10.0.0.0/24"
97+
protocol: 6
98+
tcp_options:
99+
destination_port_range:
100+
max: 8080
101+
min: 8080
102+
- source: "0.0.0.0/0"
103+
protocol: 6
104+
tcp_options:
105+
destination_port_range:
106+
max: 8443
107+
min: 8443
108+
{% endif %}

olam/templates/nginx.conf.j2

Lines changed: 24 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,56 +42,30 @@ http {
4242
# for more information.
4343
include /etc/nginx/conf.d/*.conf;
4444

45-
# server {
46-
# listen 80 default_server;
47-
# listen [::]:80 default_server;
48-
# server_name _;
49-
# root /usr/share/nginx/html;
50-
#
51-
# # Load configuration files for the default server block.
52-
# include /etc/nginx/default.d/*.conf;
53-
#
54-
# location / {
55-
# }
56-
#
57-
# error_page 404 /404.html;
58-
# location = /40x.html {
59-
# }
60-
#
61-
# error_page 500 502 503 504 /50x.html;
62-
# location = /50x.html {
63-
# }
64-
# }
65-
#
66-
# Settings for a TLS enabled server.
67-
#
68-
# server {
69-
# listen 443 ssl http2 default_server;
70-
# listen [::]:443 ssl http2 default_server;
71-
# server_name _;
72-
# root /usr/share/nginx/html;
73-
#
74-
# ssl_certificate "/etc/pki/nginx/server.crt";
75-
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
76-
# ssl_session_cache shared:SSL:1m;
77-
# ssl_session_timeout 10m;
78-
# ssl_ciphers PROFILE=SYSTEM;
79-
# ssl_prefer_server_ciphers on;
80-
#
81-
# # Load configuration files for the default server block.
82-
# include /etc/nginx/default.d/*.conf;
83-
#
84-
# location / {
85-
# }
86-
#
87-
# error_page 404 /404.html;
88-
# location = /40x.html {
89-
# }
90-
#
91-
# error_page 500 502 503 504 /50x.html;
92-
# location = /50x.html {
93-
# }
94-
# }
45+
{% if use_haproxy %}
46+
server {
47+
listen 8080 default_server;
48+
listen [::]:8080 default_server;
49+
server_name _;
50+
root /usr/share/nginx/html;
51+
52+
# Load configuration files for the default server block.
53+
include /etc/nginx/default.d/*.conf;
54+
55+
# OCI LB health check
56+
location /nginx-health {
57+
access_log off;
58+
add_header 'Content-Type' 'text/plain';
59+
return 200 "healthy\n";
60+
}
61+
62+
location /health {
63+
access_log off;
64+
add_header 'Content-Type' 'application/json';
65+
return 200 '{"status":"UP"}';
66+
}
67+
}
68+
{% endif %}
9569

9670
}
9771

0 commit comments

Comments
 (0)