__________ _____________ ___ .___ __ .__
\______ \/ _____/ | \ __| _/_______ ___/ |_ ____ ____ | |
| ___/\_____ \| | / / __ |/ __ \ \/ /\ __\/ _ \ / _ \| |
| | / \ | / / /_/ \ ___/\ / | | ( <_> | <_> ) |__
|____| /_______ /______/ \____ |\___ >\_/ |__| \____/ \____/|____/
\/ \/ \/
Installation
Download to Install
Download the latest binary for your system from releases. Make sure the go bin is on your $PATH
.
Use Go Install
make sure you are not within a golang project (ie cd $home
)
go install git.psu.edu/k8s/devtool@latest
Homebrew
Setup homebrew: https://git.psu.edu/swe-golang/homebrew-tap/-/blob/master/README.md
brew install devtool
Help
A tool used by software engineering to build applications.
Usage:
devtool [command]
Available Commands:
build build the application
ci Build tools for the CI system
clean delete the helm release(s)
config Manage the projects build configuration
help Help about any command
run run the application
start start the minikube environment
version displays the software version
Flags:
--config string config file (default is $HOME/.devtool.yaml)
-h, --help help for devtool
Use "devtool [command] --help" for more information about a command.
Configuration
The devtool commands can be configured through CLI arguments, through ENV variables, or a global configuration file (~/.devtool.yaml)
k8s:
provider: kind
minikube:
memory: 8192
cpu: 6
k8s:
version: v1.22.9
kind:
name: devtool
workers: 2
k8s:
version: v1.22.9
nginx-ingress:
version: v4.10.0
build:
skipCompile: false
runTests: true
openServices: false
webaccess:
user: crh5255
Choosing versions
When configuring the local k8s cluster (minikube or kind), it is best practice to set the k8s.version variable and use a k8s version that matches the QNA cluster instead of defaulting to the latest release.
For kind clusters, you should also set the nginx-ingress.version variable because the nginx-ingress install can have compatibility issues depending on what version of k8s you are using. The documented compatibility chart is located at https://github.com/kubernetes/ingress-nginx -- use the value in the Helm Chart Version column, not the Ingress-NGINX version column.
While this chart documents the k8s releases it promises to support in the "k8s supported version" column, you may have luck using other combinations, but do this at your own risk. Specifically, the 4.12 of nginx-ingress seems to be a breaking change for v1.22.9 k8s clusters. The page reports the last version of nginx-ingress that promised to support v1.22 of k8s was 4.3.0, but there are many versions post 4.3.0 but pre 4.12 that have appeared to work fine in kind until 4.12 broke completely.
Local-Only Deployments
The devtool supports deploying additional charts locally to simulate development resources. This eliminates the need to alter/maintain charts to add resources that will never be needed in production environments.
{
"name": "accounts-service",
"language": "java",
"deployables": [
{
"name": "accounts-service",
"dockerfile": "Dockerfile",
"chart": "psu-shared/eio-swe-service",
"chartVersion": "0.14.0",
"localConfig": "config/local.yml"
},
{
"name": "accounts-service-postgres",
"chart": "postgresql",
"chartVersion": "0.18.1",
"localConfig": "config/local-postgres.yml",
"localOnly": true
}
],
"localEnvVars": ["OAUTH_CLIENT_ID"],
"localSecrets": ["OAUTH_CLIENT_SECRET","OAUTH_JWK"]
}
config/local-postgres.yml:
service:
type: NodePort
enabled: true
postgresUser: accounts_service_user
postgresPassword: secret
postgresDatabase: accounts_service