On Mon, Oct 23, 2017 at 11:09 AM Akshat Jiwan Sharma <akshatji...@gmail.com>
wrote:

> Thanks Andrew. Just one more question how does the open-port command
> behave with respect to the  firewalls with cloud providers. Specifically
> I'm asking in context of google cloud platform which by default only allows
> port 80 and 443(IIRC). So after running this command will I have to adjust
> firewall rules there as well?
>

That's exactly what open-port/expose is controlling :)

When you run open-port (or close-port), you're updating Juju's database to
say which ports should be open for the unit. When you run "juju expose", it
updates Juju's database to say that the "open" ports for the units of the
specified application should now be exposed. Juju will then update the
cloud firewall to come in line with what's in the Juju database.

Cheers,
Andrew


> Thanks,
> Akshat
>
> On Mon, Oct 23, 2017 at 7:28 AM, Andrew Wilkins <
> andrew.wilk...@canonical.com> wrote:
>
>> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <
>> akshatji...@gmail.com> wrote:
>>
>>> HI,
>>>
>>> I'm trying to manually expose a port on a juju machine. According to this
>>> answer
>>> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
>>> I should be able to do something like this:-
>>>
>>>  juju run  "open-port 443" --all
>>>
>>> However when I type this in my shell it throws an error
>>>
>>> open-port: command not found
>>>
>>
>> The different between the command you're running, and the one on
>> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
>> the command in the context of a unit on the machine. You must be running in
>> the context of a unit to use "hook tools", such as open-port.
>>
>> I can verify that the application on this particular controller is
>>> already exposed and it thus satisfies the requirement for running this
>>> command.
>>>
>>> >"The port range will only be open while the application is exposed."
>>>
>>> Can you help me understand what I'm doing wrong?
>>>
>>
>> Ports are managed on a per-unit basis, so you need to execute the "run"
>> command against a unit or application, using --unit or --application
>> respectively.
>>
>> Once you've run open-port, you'll need to run "juju expose <application>"
>> for the ports to actually be opened up.
>>
>> Thanks,
>>> Akshat
>>> --
>>> Juju mailing list
>>> Juju@lists.ubuntu.com
>>> Modify settings or unsubscribe at:
>>> https://lists.ubuntu.com/mailman/listinfo/juju
>>>
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to