elasticsearch-cloud-deploy
elasticsearch-cloud-deploy copied to clipboard
Nginx installation is missing
Hi,
Thank you for sharing your deployment plan.
I tried to find how to put client LB behind Security group to limit access to specific IPs and did not find on which point Nginx is installed and how it was provisioned.
You'll end up needing nginx anyways if you want to have the public endpoint of Kibana served behind a different port.
- I added this to the file to the assets under
assets/scripts/nginx/config-clients.sh
#!/bin/bash
set +e
sudo mkdir -p /var/log/nginx/
sudo rm /etc/nginx/sites-enabled/default
sudo touch /etc/nginx/sites-enabled/default
sudo bash -c 'cat <<EOF >>/etc/nginx/sites-enabled/default
server {
listen 80;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
proxy_pass http://$(hostname -i):5601;
}
}
EOF'
# Make sure config file is valid
sudo nginx -t
# Start nginx
systemctl enable nginx.service
sudo systemctl restart nginx
- Added this file to packer
install-nginx.sh
# Fix for the apt lock issue
sleep 100
echo "Installing Nginx"
sudo apt-get update
sudo -E apt-get install -y nginx
- Added this provisition at the end of the kibana packer file
...
},
{
"type": "shell",
"script": "install-nginx.sh",
"execute_command": "echo '' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'"
}
]
- and finally added this to the end of the client script in
assets/scripts/client.sh
/opt/cloud-deploy-scripts/nginx/config-clients.sh
Hope this helps