Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use install.sh script in cloud init of the terraform digitialocean example #236

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

jsiebens
Copy link
Contributor

Description

This PR has the following changes:

  • use hack/install.sh script in cloud-init startup script
  • removed duplicate terraform setup

Motivation and Context

  • I have raised an issue to propose this change this is required

fixes #226

How Has This Been Tested?

Successfully provisioned a new droplet with faasd and Caddy:

$ terraform apply
....
Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

random_password.password: Creating...
random_password.password: Creation complete after 0s [id=none]
data.template_file.cloud_init: Reading...
data.template_file.cloud_init: Read complete after 0s [id=44afd559f7265ba322f209a3097daccd214769b2b16b28935e00e2b0e6acd9a6]
digitalocean_ssh_key.faasd_ssh_key: Creating...
digitalocean_ssh_key.faasd_ssh_key: Creation complete after 1s [id=32932367]
digitalocean_droplet.faasd: Creating...
digitalocean_droplet.faasd: Still creating... [10s elapsed]
digitalocean_droplet.faasd: Still creating... [20s elapsed]
digitalocean_droplet.faasd: Still creating... [30s elapsed]
digitalocean_droplet.faasd: Still creating... [40s elapsed]
digitalocean_droplet.faasd: Still creating... [50s elapsed]
digitalocean_droplet.faasd: Creation complete after 58s [id=282809025]

Apply complete! Resources: 3 added, 0 changed, 0 destroyed.

Outputs:

droplet_ip = "167.99.254.29"
gateway_url = "https://faasd.j5s.io/"
login_cmd = <sensitive>
password = <sensitive>

$ terraform output login_cmd
"faas-cli login -g https://faasd.j5s.io/ -p <redacted>"

$ faas-cli login -g https://faasd.j5s.io/ -p <redacted>
WARNING! Using --password is insecure, consider using: cat ~/faas_pass.txt | faas-cli login -u user --password-stdin
Calling the OpenFaaS server to validate the credentials...
credentials saved for admin https://faasd.j5s.io

Checks on the droplets:

root@faasd:~# systemctl status faasd
● faasd.service - faasd
   Loaded: loaded (/lib/systemd/system/faasd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-01-19 13:09:37 UTC; 1min 21s ago
 Main PID: 2167 (faasd)
    Tasks: 6 (limit: 1151)
   CGroup: /system.slice/faasd.service
           └─2167 /usr/local/bin/faasd up
root@faasd:~# systemctl status faasd-provider
● faasd-provider.service - faasd-provider
   Loaded: loaded (/lib/systemd/system/faasd-provider.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-01-19 13:09:37 UTC; 1min 24s ago
 Main PID: 2159 (faasd)
    Tasks: 3 (limit: 1151)
   CGroup: /system.slice/faasd-provider.service
           └─2159 /usr/local/bin/faasd provider
root@faasd:~# systemctl status caddy
● caddy.service - Caddy
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-01-19 13:09:39 UTC; 8s ago
     Docs: https://caddyserver.com/docs/
 Main PID: 2240 (caddy)
    Tasks: 7 (limit: 1151)
   CGroup: /system.slice/caddy.service
           └─2240 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Commits:

  • I've read the CONTRIBUTION guide
  • My commit message has a body and describe how this was tested and why it is required.
  • I have signed-off my commits with git commit -s for the Developer Certificate of Origin (DCO)

Code:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.

Docs:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

- removed duplicate terraform setup

Signed-off-by: Johan Siebens <johan.siebens@gmail.com>
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alexellis alexellis merged commit 1822114 into openfaas:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Caddy version used in faasd-digitalocean-terraform example
2 participants