No description
Find a file
2024-12-07 11:56:40 +01:00
.idea-configs refactor: *.k3s -> server 2022-01-18 20:10:18 +01:00
.run [skip ci] fix test_incl_containtertests.run.xml 2024-09-12 20:12:25 +02:00
doc [skip ci] add doc about modules 2024-09-06 22:30:01 +02:00
gradle/wrapper v0.8.33-SNAPSHOT - upd deps, fix fatJar Main class 2021-12-27 22:18:55 +01:00
src [skip ci] correct help text for binaries 2024-12-07 11:47:04 +01:00
.gitignore update some deps 2024-09-30 22:06:46 +02:00
.gitlab-ci.yml test in pipeline only for tags 2024-11-25 21:40:22 +01:00
build.gradle [skip ci] add cmt 2024-12-07 11:56:40 +01:00
build.py bump version to: 0.38.3-SNAPSHOT 2024-10-04 23:57:15 +02:00
desktop-config-example.yaml release-0.11.10 - rename workplace to desktop 2022-06-16 22:57:08 +02:00
Dockerfile update images for integration tests to ubuntu 22.04 2024-05-24 11:34:45 +02:00
gradle.properties run container tests in ci 2021-02-25 19:57:06 +01:00
gradlew initial commit 2021-02-10 20:24:43 +01:00
gradlew.bat initial commit 2021-02-10 20:24:43 +01:00
LICENSE update README.md 2021-02-11 18:03:13 +01:00
README.md [skip ci] update README.md and docs 2024-08-16 17:31:12 +02:00
settings.gradle correct maven name to provs 2021-08-07 19:14:12 +02:00

provs

pipeline status

DeltaChat chat over e-mail | M meissa@social.meissa-gmbh.de | Blog | Website

Purpose

provs provides cli-based tools for

  • provisioning desktop software for different desktop types:
    • basic
    • office
    • IDE
  • provisioning a k3s server
  • performing system checks

Tasks can be run locally or remotely.

Try out

Prerequisites

  • A Java Virtual machine (JVM) is required.
  • Install jarwrapper (e.g. sudo apt install jarwrapper)
  • Then either download the binaries or build them yourself

Download the binaries

  • Download the latest provs-desktop.jar,provs-server.jar and/or provs-syspec.jar from: https://gitlab.com/domaindrivenarchitecture/provs/-/releases
    • Preferably into /usr/local/bin or any other folder where executables can be found by the system
  • Make the jar-file executable e.g. by chmod +x provs-desktop.jar
  • Check with provs-desktop.jar -h to show help information
Build the binaries

Instead of downloading the binaries you can build them yourself

  • Clone this repository
  • In the repository's root folder execute: ./gradlew install. This will install the binaries in /usr/local/bin

Provision a desktop

After having installed provs-desktop.jar (see prerequisites) execute:

provs-desktop.jar <type> <target> [<options>]

type can be:

  • basic - install some basic packages)
  • office - install office software (LibreOffice), E-Mail (Thunderbird), etc
  • ide - same as office with additionally ide-software (VSCode, IntelliJ, etc)

target can be:

  • local
  • remote, e.g. user123:mypassword@myhost.com - general format is: <user[:password]@host> -
    • be sure to have openssh-server installed
    • add your preferred public key to known_hosts on the target machine
    • if password is omitted, then ssh-keys will be used for authentication
    • if password is omitted but option -p is provided, then the password will be prompted interactively

options

  • -p for interactive password question
  • -o for only executing one action, e.g.
    • -o verify for verifying your installation
    • -o firefox to install firefox from apt on ubuntu

Example

provs-desktop.jar basic local # installs a basic desktop on a local machine
provs-desktop.jar office myuser@myhost.com -p # installs an office desktop on a remote machine, prompting for password
provs-desktop.jar ide myuser@myhost.com # installs an ide on a local machine
provs-desktop.jar ide myuser@myhost.com -o firefox # installs firefox on a remote machine
provs-desktop.jar ide myuser@myhost.com -o verify # verifies the installation on a remote machine

Provision a k3s Server

provs-server.jar k3s local # installs a k3s server locally
provs-server.jar k3s myuser@myhost.com # install remote k3s using ssh-authentication // option -p for password authentication
provs-server.jar k3s myuser@myhost.com  -c path/to/k3sServerConfig.yaml -a path/to/application.yaml # as above, but define paths to your application and config yamls

For the remote server please configure a config file (default file name: server-config.yaml). It has to be in the same folder where you execute the provs-server.jar command.

fqdn: "myhostname.com"
node:
  ipv4: "192.168.56.123"   # ip address
echo: true                 # for demo reasons only - deploys an echo app 

To add a grafana agent to your k3s installation add the following to the config:

grafana:
  user: "myusername"   # username for the grafana data source 
  password:
    source: "PLAIN"           # PLAIN, GOPASS or PROMPT
    parameter: "mypassword"   # the password or api key for the grafana data source user 
  cluster: "mycluster"        # a cluster name of your choice  

To provision the grafana agent only to an existing k8s system, ensure that the config (as above) is available and execute:

provs-server.jar k3s myuser@myhost.com -o grafana

To add the hetzner csi driver and encrypted volumes to your k3s installation add the following to the config:

hetzner:
  hcloudApiToken:
    source: "PLAIN"           # PLAIN, GOPASS or PROMPT
    parameter: "mypassword"   # the api key for the hetzner cloud
  encryptionPassphrase:
    source: "PLAIN"           # PLAIN, GOPASS or PROMPT
    parameter: "mypassword"   # the encryption passphrase for created volumes

To provision the grafana agent only to an existing k8s system, ensure that the config (as above) is available and execute:

provs-server.jar k3s myuser@myhost.com -o grafana

Reprovisioning the server can easily be done using the -r or --reprovision option.

provs-server.jar k3s myuser@myhost.com -c path/to/k3sServerConfig.yaml -a path/to/application.yaml -r # 

Or you can add reprovision: true to your k3sServerConfig.yaml.

Perform a system check

The default config-file for the system check is syspec-config.yaml, you can specify a different file with option -c <config-file>.

provs-syspec.jar local 
# or remote with a custom config filename
provs-syspec.jar myuser@myhost.com -c my-syspec-config.yaml

Example output:

Syspec output example

Get help

To get help you can make use of the -h option:

provs-desktop.jar -h
provs-server.jar -h
provs-syspec.jar -h

Or to get help for subcommands e.g.

provs-desktop.jar ide -h
provs-server.jar k3s -h

Development & mirrors

Development happens at: https://repo.prod.meissa.de/meissa/provs

Mirrors are:

For more details about our repository model see: https://repo.prod.meissa.de/meissa/federate-your-repos

Developer information

For using provs framework, add the required dependency to your project, then you can implement your own tasks e.g. by:

import org.domaindrivenarchitecture.provs.framework.core.Prov

fun Prov.myCustomTask() = task {
    cmd("echo \"Hello world!\"")
}

See also ForDevelopers.md