Home

Awesome

photon-mgmtd

photon-mgmtd is a high performance open-source, simple, and pluggable REST API gateway designed with stateless architecture. It is written in Go, and built with performance in mind. It features real time health monitoring, configuration and performance for systems (containers), networking and applications.

Features!

Building and installation from source



❯ make build
❯ sudo make install

Due to security photon-mgmtd runs in non root user photon-mgmt. It drops all privileges except CAP_NET_ADMIN and CAP_SYS_ADMIN.


❯  useradd -M -s /usr/bin/nologin photon-mgmt

Configuration


Configuration file mgmt.toml located in /etc/photon-mgmt/ directory to manage the configuration.

The [System] section takes following Keys:

LogLevel=

Specifies the log level. Takes one of Trace, Debug, Info, Warning, Error, Fatal and Panic. Defaults to info. See sirupsen

UseAuthentication= A boolean. Specifies whether the users should be authenticated. Defaults to true.

The [Network] section takes following Keys:

Listen= Specifies the IP address and port which the REST API server will listen to. When enabled, defaults to 127.0.0.1:5208.

ListenUnixSocket= A boolean. Specifies whether the server would listen on a unix domain socket /run/photon-mgmt/mgmt.sock. Defaults to true.

Note that when both ListenUnixSocket= and Listen= are enabled, server listens on the unix domain socket by default.

❯ sudo cat /etc/photon-mgmt/mgmt.toml
[System]
LogLevel="debug"
UseAuthentication="false"

[Network]
ListenUnixSocket="true"
❯ sudo systemctl start photon-mgmtd
❯ sudo systemctl status photon-mgmtd
● photon-mgmtd.service - A REST API based configuration management microservice gateway
     Loaded: loaded (8;;file://zeus/usr/lib/systemd/system/photon-mgmtd.service^G/usr/lib/systemd/system/photon-mgmtd.service8;;^G; enabled; preset: enabled)
     Active: active (running) since Thu 2023-01-26 11:34:05 UTC; 2min 44s ago
   Main PID: 668 (photon-mgmtd)
      Tasks: 6 (limit: 18735)
     Memory: 22.8M
     CGroup: /system.slice/photon-mgmtd.service
             └─668 /usr/bin/photon-mgmtd

Jan 26 11:34:05 zeus systemd[1]: photon-mgmtd.service: Changed dead -> running
Jan 26 11:34:05 zeus systemd[1]: photon-mgmtd.service: Job 185 photon-mgmtd.service/start finished, result=done
Jan 26 11:34:05 zeus systemd[1]: Started A REST API based configuration management microservice gateway.
Jan 26 11:34:05 zeus systemd[668]: photon-mgmtd.service: Executing: /usr/bin/photon-mgmtd
Jan 26 11:34:05 zeus photon-mgmtd[668]: time="2023-01-26T11:34:05Z" level=info msg="photon-mgmtd: v0.1 (built go1.19.3)"
Jan 26 11:34:05 zeus photon-mgmtd[668]: time="2023-01-26T11:34:05Z" level=info msg="Starting photon-mgmtd... Listening on unix domain socket='/run/photon-mgmt/mgmt.sock' in HTTP>
Jan 26 11:36:43 zeus systemd[1]: photon-mgmtd.service: Trying to enqueue job photon-mgmtd.service/start/replace
Jan 26 11:36:43 zeus systemd[1]: photon-mgmtd.service: Installed new job photon-mgmtd.service/start as 596
Jan 26 11:36:43 zeus systemd[1]: photon-mgmtd.service: Enqueued job photon-mgmtd.service/start as 596
Jan 26 11:36:43 zeus systemd[1]: photon-mgmtd.service: Job 596 photon-mgmtd.service/start finished, result=done

For a comprehensive list use cases, see usecases.