halkyonio / hal Goto Github PK
View Code? Open in Web Editor NEWEasily create and manage Kubernetes applications using the Halkyon operator, made with ❤️ by the Halkyon team.
License: GNU General Public License v3.0
Easily create and manage Kubernetes applications using the Halkyon operator, made with ❤️ by the Halkyon team.
License: GNU General Public License v3.0
IMHO, asciinema clips are meant to be as short as possible.
So, there are some things about our current asciinema that thrwos me off.
This makes it TOO long.
Also all the usefull information displayed is gone as soon as the step is finished.
IMHO, whats written in the asciinema should be part of the readme and not part of the clip.
I don't get enough time to digest what I just saw. Before I even get the time to skim through the options, the screen is cleared.
It goes from the beggining to to our fruit
demo.
This is can make an excellent demo, but I am not sure about an asciinema.
I think that what the asciinema shows, should be part of a getting started guide enriched with individual asciinemas for each step.
hal project my-new-project
? Spring Boot version [Use arrows to move, space to select, type to filter]
Pressing the space bar on the default selection removes the list.
This would help usability when using plain k8s clusters as target.
Building instructions seem to not work
$> go build cmd/kreate.go
# github.com/snowdrop/kreate/pkg/kreate/cli/mode
pkg/kreate/cli/mode/mode.go:39:93: component.Spec.DeploymentMode.String undefined (type string has no field or method String)
pkg/kreate/cli/mode/mode.go:49:41: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".DevDeploymentMode
pkg/kreate/cli/mode/mode.go:49:69: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".BuildDeploymentMode
# github.com/snowdrop/kreate/pkg/kreate/cli/link
pkg/kreate/cli/link/link.go:45:19: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".SecretLinkKind
pkg/kreate/cli/link/link.go:57:19: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".EnvLinkKind
pkg/kreate/cli/link/link.go:102:33: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".LinkKind
pkg/kreate/cli/link/link.go:126:41: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".EnvLinkKind
pkg/kreate/cli/link/link.go:126:63: undefined: "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".SecretLinkKind
# github.com/snowdrop/kreate/pkg/kreate/cli/push
pkg/kreate/cli/push/push.go:66:31: component.Spec.Revision undefined (type "github.com/snowdrop/component-operator/pkg/apis/component/v1alpha2".ComponentSpec has no field or method Revision)
$> go version
go version go1.12.7 linux/amd64
$>
$> echo $GOPATH
No parameter exists to specify the location/path of the project to be created. So, by example, if the project to be created is test
, then we can't specify this parameter using the kreate project
command
kreate project \
-i fruit-client-sb \
-g io.cool \
-p io.cool.demo \
-s 2.1.6.RELEASE \
-t client \
-v 1.0.0-SNAPSHOT \
--supported=false
Selected Spring Boot: 2.1.6.RELEASE
Selected template: client
Selected Group Id: io.cool
Selected Artifact Id: fruit-client-sb
Selected Version: 1.0.0-SNAPSHOT
Selected Package name: io.cool.demo
? Project location (immediate child directory of /Users/dabou/Code/snowdrop/kreate)
Ideally we should pass the name of the folder of the project to be created as last item of the command
-i fruit-client-sb \
-g io.cool \
-p io.cool.demo \
-s 2.1.6.RELEASE \
-t client \
-v 1.0.0-SNAPSHOT \
--supported=false \
test
Selected Spring Boot: 2.1.6.RELEASE
Selected template: client
Selected Group Id: io.cool
Selected Artifact Id: fruit-client-sb
Selected Version: 1.0.0-SNAPSHOT
Selected Package name: io.cool.demo
When we use the new command hal component create -t client fruit-client-sb
, then the src/main/resources/application.properties
file contains an empty dekorate component name
dekorate.component.name=
The consequence is that now, when we build the project, then the dekorate halkyon yml file contains as component name -> myproject
apiVersion: "v1"
kind: "List"
items:
- apiVersion: "halkyon.io/v1beta1"
kind: "Component"
metadata:
labels:
app: "myproject"
name: "myproject"
spec:
deploymentMode: "dev"
runtime: "spring-boot"
version: "2.1.6.RELEASE"
exposeService: true
port: 8080
Add new option/question for the interactive mode when we create a project to ask when we select dekorate
if we want to use :
I'm thinking that we need a command hal new-build
able to start/trigger a new taskrun build.
hal new-build -c fruit-client-sb
The easiest approach is to delete the taskrun
resource which has been created by the operator for the specified component and then a new one will be re-created automatically.
Of course, this approach means that we will not use any update of the buildConfig
and that we will deploy a new Task/TaskRun
oc get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
fruit-backend-sb True Succeeded 31m 28m
fruit-client-sb True Succeeded 31m 28m
oc delete taskruns/fruit-backend-sb
taskrun.tekton.dev "fruit-backend-sb" deleted
oc get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
fruit-backend-sb Unknown Pending 4s
fruit-client-sb True Succeeded 31m 28m
When I issue hal component push
, I get Performing build
, the pod log clearly shows that Maven started running, and very quickly I get Restarting app
and the pod log starts showing attempts to start /deployments/app.jar
. The Maven build didn't finish yet, though. The pod log now has mixed outputs of Maven and the attempts to start the app.
This most likely isn't an issue in hal itself -- hal simply waits for /var/lib/supervisord/bin/supervisord ctl start build
to finish -- but I'm not sure where else to file this. It's a deficiency of the supervisord
-based architecture.
It's quite simple to workaround this in hal
itself; add this after the code that remotely executes /var/lib/supervisord/bin/supervisord ctl start build
:
if err = c.ExecCommand(podName, []string{"bash", "-c", "while /var/lib/supervisord/bin/supervisord ctl status build | grep RUNNING; do sleep 1; done"},
"Waiting for build to finish"); err != nil {
return err
}
Add new command to let the developer to install a list of operator
hal install operator1,operator2,...
where the command will:
Remark: The list of the operators to be installed could be replaced with different profiles: - default: halkyon, tekton & kubedb - hal install-p default
Can hal link
filter the secrets to be selected to avoid to also display the token, cfg populated by k8s or ocp ?
We must standardize how we use the parameter -c
as it is used to create a component but not to delete it
hal component delete fruit-client-sb
? Really delete 'fruit-client-sb' component Yes
✓ Successfully deleted 'fruit-client-sb' component
hal component create -c fruit-client-sb
'fruit-client-sb' component was not found, initializing it
◒ Waiting for component fruit-client-sb to be ready…
Our readme doesn't say much, other than that it creates components.
Its totally unclear to new users what this means.
Does it scaffold?
Does it generate resources?
Does it deploy?
Per @iocanel:
Scaffolding should have it own command. Something like hal component scaffold
would be the most descriptive. The command could work interactively or using arguments and allow us to scaffold projects like we do now.
Then hal component create
would have a narrower scope and it would be easier to explain what it does.
Some technical concerns around this suggestion, is that we will have to ask the user twice about the runtime, which is bad ux.
To overcome this issue, we could save information like the runtime, the version etc in a .hal file, that will be created when we scaffold.
An alternative would be to implement a mechanism to detect the target runtime, using parsing of known project models (maven, gradle, npm).
$ hal project my-new-project
? Spring Boot version 2.1.6.RELEASE
? Use 2.1.6.RELEASE supported version Yes
Selected supported Spring Boot: 2.1.3.Final-redhat-00001
We get this error
FATA[0053] error running spring-boot: failed to download file /home/lab/fruit-client-sb.zip due to open /home/lab/fruit-client-sb.zip: permission denied
if we scaffold a hal component spring boot using a docker container
docker run --rm --name hal -v "$(pwd)":/home/lab -it quay.io/halkyonio/hal:v0.1.7 bash
oc login https://195.201.87.126:8443 --token=TOKEN
bash-5.0$ hal component spring-boot fruit-client-sb
? Spring Boot version 2.1.6.RELEASE
? Use 2.1.6.RELEASE supported version No
? Create from template Yes
? Available templates client
? Group Id me.fruitstand
? Artifact Id fruit-client-sb
? Version 1.0.0-SNAPSHOT
? Package name me.fruitstand.demo
FATA[0053] error running spring-boot: failed to download file /home/lab/fruit-client-sb.zip due to open /home/lab/fruit-client-sb.zip: permission denied
bash-5.0$ ls -la
total 8
drwxr-xr-x 1 1000 50 64 Sep 20 11:50 .
drwxr-xr-x 1 root root 4096 Sep 20 11:51 ..
Create capability command asks again to pass a parameter even if it has been defined within the command
hal capability create -n postgres-db -g database -t postgres -v 10 -p DB_NAME=sample-db -p DB_PASSWORD=admin -p DB_USER=admin
Selected category: database
Selected type: postgres
Selected version: 10
Set parameter: DB_NAME=sample-db
Set parameter: DB_PASSWORD=admin
Set parameter: DB_USER=admin
Selected Name: postgres-db
? Enter a value for string property DB_NAME:
This command is what the help command mentions
Examples:
# Create a new database capability of type postgres 10 and sets up some parameters as the name of the database and the user/password to connect.
hal capability create -n db-capability -g database -t postgres -v 10 -p DB_NAME=sample-db -p DB_PASSWORD=admin -p DB_USER=admin
{"level":"info","ts":1580136965.497557,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"capability-controller","source":"kind source: kubedb.com/v1alpha1, Kind=Postgres"}
{"level":"error","ts":1580136965.869699,"logger":"capability-controller","msg":"Failed to create new ","kind":"Postgres","error":"admission webhook \"postgres.validators.kubedb.com\" denied the request: postgresversions.catalog.kubedb.com \"4.1.7\" not found","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/Users/claprun/Dev/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128\nhalkyon.io/operator-framework.CreateOrUpdate\n\t/Users/claprun/Dev/go/pkg/mod/halkyon.io/[email protected]/dependent.go:78\nhalkyon.io/operator-framework.(*BaseResource).CreateOrUpdateDependents\n\t/Users/claprun/Dev/go/pkg/mod/halkyon.io/[email protected]/baseresource.go:33\nhalkyon.io/operator/pkg/controller/capability.(*Capability).CreateOrUpdate\n\t/Users/claprun/Dev/go/src/halkyon.io/operator/pkg/controller/capability/capability.go:26\nhalkyon.io/operator-framework.(*GenericReconciler).Reconcile\n\t/Users/claprun/Dev/go/pkg/mod/halkyon.io/[email protected]/generic.go:76\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/Users/claprun/Dev/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:215\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\t/Users/claprun/Dev/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:158\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/Users/claprun/Dev/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/Users/claprun/Dev/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:134\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/Users/claprun/Dev/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:88"}
It seems like the proper GVK is not being registered when watches are recorded…
Change the package name proposed to dev.snowdrop.demo
instead of me.snowdrop.demo
? Package name me.snowdrop.demo
How can we pass the parameters as the command definition don't provide an example - -p, --parameters strings Capability-specific parameters
?
I tried hal capability -g database -t postgres -v 10 -p DB_NAME=sample-db -p DB_PASSWORD=admin -p DB_USER=admin
but this is not correct
hal capability -g database -t postgres -v 10 -p DB_NAME=sample-db -p DB_PASSWORD=admin -p DB_USER=admin
Selected category: database
Selected type: postgres
Selected version: 10
Set parameter: DB_NAME=sample-db
Set parameter: DB_PASSWORD=admin
Set parameter: DB_USER=admin
? Change default name postgres-capability-1568190180775805000
? Enter a value for string property DB_NAME:
QUESTION: Can we pass the name of the capability to be created using a command ?
We observe a weird behaviour when try to pass as parameter -o
or --supported
. See hereafter
Good
kreate project -i fruit-client-sb -g io.cool -p io.cool.demo --supported=false -s 2.1.6.RELEASE -t client -v 1.0.0-SNAPSHOT
Selected Spring Boot: 2.1.6.RELEASE
Selected template: client
Selected Group Id: io.cool
Selected Artifact Id: fruit-client-sb
Selected Version: 1.0.0-SNAPSHOT
Selected Package name: io.cool.demo
? Project location (immediate child directory of /Users/dabou/Code/snowdrop/kreate)
Bad
kreate project -i fruit-client-sb -g io.cool -p io.cool.demo -s 2.1.6.RELEASE -t client -v 1.0.0-SNAPSHOT
Selected Spring Boot: 2.1.6.RELEASE
? Use 2.1.6.RELEASE supported version (Y/n)
When we don't pass the parameter -o or --supported
, then a question is asked while in fact the default option which is false should be used
Going through the demo I see
hal component spring-boot
and hal component create
which is confusing.
As both pretty much imply
skafolding. The latter should be
deploy` or something.
Currently it is very hard to figure out what a component looks like
So I would like to propose that we add a new command to kreate
in order to have the possibility to get such info
Examples
kreate get component -n <name>
where <name> is the name of the component
output
Name: name of the component
Labels: // list of labels
Annotations: // list of annotations
Status:
Links: // Links assigned to the component
Envs: // Env vars created or enriched using Link
Capabilities: // List of capabilities used: db, ...
Route: // URL of the route exposed
...
To get such info it is needed now that we execute several commands like
// To get a component or a link or a capability
kc get component/fruit-client-sb,link/link-to-fruit-backend,capability...
// To get the detail of a pod = component + env vars, ...
kc describe pod/$(kc get pod -n demo -lapp=fruit-client-sb | grep "Running" | awk '{print $1}')
// To get ENV vars created when container starts
kc exec -n demo $(kc get pod -n demo -lapp=fruit-backend-sb | grep "Running" | awk '{print $1}') env | grep DB
Hal version : v0.1.4
If we have previously deploy the components and we re-deploy then that fails
hal component push -c fruit-client-sb,fruit-backend-sb
✓ Uploading /Users/dabou/Temp/rhtelab/fruit-client-sb/target/fruit-client-sb-1.0.0-SNAPSHOT.jar
✗ Uploading /Users/dabou/Temp/rhtelab/fruit-backend-sb/target/fruit-backend-sb-1.0.0-SNAPSHOT.jar
FATA[0063] error running push: error uploading jar: exit status 1
hal component push -c fruit-client-sb,fruit-backend-sb
No local changes detected for 'fruit-client-sb' component: nothing to push!
✗ Uploading /Users/dabou/Temp/rhtelab/fruit-backend-sb/target/fruit-backend-sb-1.0.0-SNAPSHOT.jar
FATA[0005] error running push: error uploading jar: exit status 1
The following docker command
docker run --rm --name hal -v "$(pwd)":/home/lab -it quay.io/halkyonio/hal:v0.1.7 bash
bash-5.0$ hal version
reports the error
FATA[0000] error creating k8s config: errConfigurationInvalid: invalid configuration: no configuration has been provided
Hi, if you want to keep track of the current Vert.x versions you can query: https://start.vertx.io/metadata
Request: Improve the message displayed when link can't be created if by example the secret is not available. We should perhaps tell him to re-play the command, maybe to check if the secret exists instead o this generic message error completing create: no valid secrets currently exist on the cluster
hal link create -n backend-to-db -t fruit-backend-sb -s postgres-db-config
✗ error completing create: no valid secrets currently exist on the cluster
Same remark too if the link already exists
oc get links
NAME AGE STATUS MESSAGE
backend-to-db 11m Pending Waiting for the following resources:
Component: Ready
client-to-backend 1m Pending Waiting for the following resources:
Component: Ready
hal link create -n backend-to-db -t fruit-backend-sb -s postgres-db-config
Selected link type: Secret
Selected Change default name: backend-to-db
✗ error running create: error communicating with cluster: AlreadyExists
I'm connected to the cluster but don't have the cluster-admin role. When try to get the hal -version
I get the error bellow:
panic: runtimes.halkyon.io is forbidden: User "amunozhe" cannot list runtimes.halkyon.io at the cluster scope: no RBAC policy matched
goroutine 7 [running]:
halkyon.io/hal/pkg/hal/cli/component.getRuntimes.func1(0xc0000b6600)
/home/amunozhe/git/hal/pkg/hal/cli/component/create.go:230 +0x4da
created by halkyon.io/hal/pkg/hal/cli/component.getRuntimes
/home/amunozhe/git/hal/pkg/hal/cli/component/create.go:227 +0x58
The capability generated by the command hal capability
is not correct
hal capability
? Category database
? Type postgres
? Version 10
? Change default name (postgres-capability-1568134805423273000)
? Enter a value for string property DB_NAME: sample-db
? Enter a value for string property DB_PASSWORD: admin
? Enter a value for string property DB_USER: admin
✓ Created capability postgres-capability-1568134805423273000
oc get cap -o yaml
apiVersion: v1
items:
- apiVersion: halkyon.io/v1beta1
kind: Capability
metadata:
creationTimestamp: 2019-09-10T17:01:36Z
generation: 1
name: postgres-capability-1568134805423273000
namespace: rhtelab
resourceVersion: "642593"
selfLink: /apis/halkyon.io/v1beta1/namespaces/rhtelab/capabilities/postgres-capability-1568134805423273000
uid: a665ce7d-d3ec-11e9-88ca-06aaef5cff46
spec:
category: Database
parameters:
- {}
- {}
- {}
- name: DB_NAME
value: sample-db
- name: DB_PASSWORD
value: admin
- name: DB_USER
value: admin
type: Postgres
version: "10"
This cap yaml ill of course generates this error with the reconciler
2019-09-10T17:03:05.549Z ERROR kubebuilder.controller Reconciler error {"controller": "capability-controller", "request": "rhtelab/postgres-capability-1568134805423273000", "error": "failed to create or update Capability 'postgres-capability-1568134805423273000': unsupported 'Database' capability category"}
github.com/go-logr/zapr.(*zapLogger).Error
/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:217
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:158
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
/go/pkg/mod/github.com/kmodules/[email protected]/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.JitterUntil
/go/pkg/mod/github.com/kmodules/[email protected]/pkg/util/wait/wait.go:134
k8s.io/apimachinery/pkg/util/wait.Until
/go/pkg/mod/github.com/kmodules/[email protected]/pkg/util/wait/wait.go:88```
I would like to propose that we consider to use a package manager (brew, yum, apt, ...) to install hal
on the laptop of the user
Component seems to be successfully created but its status is Failed
with the component 'fruit-client-sb' must provide a port
message. Details:
hal version
hal v0.1.10-58-g9bd137d built with ❤️ by the Halkyon team on 'Wed Oct 23 10:14:13 CEST 2019' (commit: 9bd137d) running on top of 'oc'
Component creation:
hal component create fruit-client-sb -s true
? Runtime spring-boot
? Version 2.1.6.RELEASE
? Expose microservice No
? Group Id dev.snowdrop
? Artifact Id myproject
? Version 1.0.0-SNAPSHOT
? Package name dev.snowdrop.myproject
? Env variable in the 'name=value' format, simply press enter when finished
❯ Selected Name: fruit-client-sb
✓ Successfully created 'fruit-client-sb' component
oc get cp
NAME RUNTIME VERSION AGE MODE STATUS MESSAGE REVISION
fruit-client-sb spring-boot 2.1.6.RELEASE 14m dev Failed component 'fruit-client-sb' must provide a port
I had this error also trying with a quarkus
component like follows:
hal component create fruit-backend-sb -s true
? Runtime quarkus
? Version 0.23.2
? Expose microservice No
? Group Id dev.snowdrop
? Artifact Id myproject
? Version 1.0.0-SNAPSHOT
? Package name dev.snowdrop.myproject
? Env variable in the 'name=value' format, simply press enter when finished FOO=BAR
❯ Set env variable: FOO=BAR
? Env variable in the 'name=value' format, simply press enter when finished
❯ Selected Name: fruit-backend-sb
✘ A component named 'fruit-backend-sb' already exists, please select another name
? Name quarkus-cp
✓ Successfully created 'quarkus-cp' component
NAME RUNTIME VERSION AGE MODE STATUS MESSAGE REVISION
quarkus-cp quarkus 0.23.2 7s dev Failed component 'quarkus-cp' must provide a port```
The syntax to be used to create a link and where we pass an env k=v fails as it prompts the question ? Env variable in the 'name=value' format, press enter when done
hal link create -n client-to-backend -t fruit-client-sb -e KUBERNETES_ENDPOINT_FRUIT=http://fruit-backend-sb:8080/api/fruits
Selected link type: Env
Set env variable: KUBERNETES_ENDPOINT_FRUIT=http://fruit-backend-sb:8080/api/fruits
? Env variable in the 'name=value' format, press enter when done
Here is a Vert.x project that uses Dekorate to generate Kubernetes and Halkyon YAML.
I am using minikube.
If I run hal component push
, then hal
complains because there is no component.
I can of course run kubectl apply -f target/classes/META-INF/dekorate/halkyon.yml
which does create a component resource:
kubectl get components
NAME RUNTIME VERSION AGE MODE STATUS MESSAGE REVISION
dekorate-and-vertx 0.0.0-SNAPSHOT 2m39s dev
However the halkyon-operator-(...)
pod goes in CrashLoopBackoff
until I kubectlk delete -f target/classes/META-INF/dekorate/halkyon.yml
:
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 0 70s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 1 72s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 CrashLoopBackOff 1 85s
operators halkyon-operator-78fb78b5df-gkjnj 1/1 Running 2 87s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 2 88s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 CrashLoopBackOff 2 100s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 3 114s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 CrashLoopBackOff 3 2m9s
operators halkyon-operator-78fb78b5df-gkjnj 1/1 Running 4 2m36s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 4 2m37s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 CrashLoopBackOff 4 2m48s
operators halkyon-operator-78fb78b5df-gkjnj 1/1 Running 5 4m
operators halkyon-operator-78fb78b5df-gkjnj 0/1 Error 5 4m1s
operators halkyon-operator-78fb78b5df-gkjnj 0/1 CrashLoopBackOff 5 4m15s
operators halkyon-operator-78fb78b5df-gkjnj 1/1 Running 6 6m42s
Here is a series of hal
and kubectl
commands that exhibit funny behaviors, like failing on .editorconfig
:
➜ dekorate-and-vertx hal component push
✗ error validating push: no component named 'dekorate-and-vertx' exists, please create it first
➜ dekorate-and-vertx kubectl apply -f target/classes/META-INF/dekorate/halkyon.yml
component.halkyon.io/dekorate-and-vertx created
➜ dekorate-and-vertx hal component push
✗ error running push: walking dekorate-and-vertx/.editorconfig: dekorate-and-vertx/.editorconfig: stat: stat dekorate-and-vertx/.editorconfig: no such file or directory
➜ dekorate-and-vertx kubectl delete -f target/classes/META-INF/dekorate/halkyon.yml
component.halkyon.io "dekorate-and-vertx" deleted
➜ dekorate-and-vertx
Will kreate support to create a service/capability and provide an interactive mode as proposed with odo service
?
Rename the template client
to rest-client
to make more clear for an end user that it is a REST template that it will use as core technology.
List available
? Available templates [Use arrows to move, type to filter]
> client
crud
custom
jsp
rest
Remark : We should perhaps rename too the template rest
to rest-server
. WDYT ? @metacosm
I attempted to install/use Kreate, but I could not get it to build:
dphillips@Deven-X1E kreate (master)🎩 echo $PWD
/home/dphillips/Source/kreate
dphillips@Deven-X1E kreate (master)🎩 go version
go version go1.10.4 linux/amd64
dphillips@Deven-X1E kreate (master)🎩 ls
cmd go.mod go.sum LICENSE pkg README.md
dphillips@Deven-X1E kreate (master)🎩 go build cmd/kreate.go
cmd/kreate.go:5:2: cannot find package "github.com/snowdrop/kreate/pkg/kreate/cli" in any of:
/usr/lib/go-1.10/src/github.com/snowdrop/kreate/pkg/kreate/cli (from $GOROOT)
/home/dphillips/go/src/github.com/snowdrop/kreate/pkg/kreate/cli (from $GOPATH)
git clone https://github.com/snowdrop/component-operator-demo.git && cd component-operator-demo
mvn clean package
cd fruit-backend-sb
kreate init
kreate push
INFO[0001] Component for fruit-backend-sb initialized. Wait a few seconds for it to be ready!
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/snowdrop/kreate/pkg/kreate/cli/push.(*options).Run(0x2b45b70, 0x0, 0xc00015b500)
/Users/dabou/Code/snowdrop/kreate/pkg/kreate/cli/push/push.go:45 +0x820
github.com/snowdrop/kreate/pkg/cmdutil.GenericRun(0x20a6980, 0x2b45b70, 0xc0002e6280, 0x2b45b70, 0x0, 0x0)
/Users/dabou/Code/snowdrop/kreate/pkg/cmdutil/runnable.go:18 +0x245
github.com/snowdrop/kreate/pkg/kreate/cli/push.NewCmdPush.func1(0xc0002e6280, 0x2b45b70, 0x0, 0x0)
/Users/dabou/Code/snowdrop/kreate/pkg/kreate/cli/push/push.go:96 +0x5e
github.com/spf13/cobra.(*Command).execute(0xc0002e6280, 0x2b45b70, 0x0, 0x0, 0xc0002e6280, 0x2b45b70)
/Users/dabou/Code/go-workspace/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xc000215b80, 0x1c8b19c, 0xc000199f88, 0x10077cf)
/Users/dabou/Code/go-workspace/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
/Users/dabou/Code/go-workspace/pkg/mod/github.com/spf13/[email protected]/command.go:800
main.main()
/Users/dabou/Code/snowdrop/kreate/cmd/kreate.go:11 +0x2c
We need to review and enrich the readme.
Here some items to add:
@metacosm , @cmoulliard don't hesitate to add others items.
The flags are not showns in the Usage
of the command. It could be useful to display them for every command.
hal -h
hal v0.1.5-1-gdd06cf2 built with ❤️ by the Snowdrop team on 'Wed Sep 11 23:16:25 CEST 2019' (commit: dd06cf2) running on top of 'oc'
Easily create and manage Kubernetes applications using Dekorate and the Halkyon operator.
Usage:
hal [command]
Available Commands:
capability Create a new capability
component Manage components
help Help about any command
link Link the current (or target) component to the specified capability or component
version Displays this tool's version
Flags:
-h, --help help for hal
Expected something like:
~/git/hal$ hal -h
hal v0.1.5-1-gdd06cf2 built with ❤️ by the Snowdrop team on 'Wed Sep 11 23:16:25 CEST 2019' (commit: dd06cf2) running on top of 'oc'
Easily create and manage Kubernetes applications using Dekorate and the Halkyon operator.
Usage:
**hal [command]**
Available Commands:
capability Create a new capability
component Manage components
help Help about any command
link Link the current (or target) component to the specified capability or component
version Displays this tool's version
Flags:
-h, --help help for hal
@metacosm could you please complete the expected
according with what you have in mind?
Populate K8s annotations for prod mod according to what is discovered within the current maven project and git repo
For the moment, we hard code the info needed to perform a s2i build using ap4k k8s annotation
@KubernetesApplication(
annotations = {
@Annotation(key = "app.openshift.io/artifact-copy-args", value = "*.jar"),
@Annotation(key = "app.openshift.io/component-name", value = "fruit-backend-sb"),
@Annotation(key = "app.openshift.io/git-dir", value = "fruit-backend-sb"),
@Annotation(key = "app.openshift.io/git-ref", value = "master"),
@Annotation(key = "app.openshift.io/git-uri", value = "https://github.com/snowdrop/component-operator-demo.git"),
@Annotation(key = "app.openshift.io/java-app-jar", value = "fruit-backend-sb-0.0.1-SNAPSHOT.jar"),
@Annotation(key = "app.openshift.io/runtime-image", value = "fruit-backend-sb")
})
but most of the properties could be calculated dynamically by the kreate
tool
WDYT ? @metacosm
hal capability create
should retrieve the live data from the cluster now that it's possible instead of hardcoding values.
Now that halkyonio/operator#190 is fixed, we should retrieve the available runtimes from the cluster.
How can we define the Secret to be used for the link as I don't see a parameter ?
hal link -h
Link the current (or target) component to the specified capability or component
Usage:
hal link [flags]
Flags:
-e, --env strings Additional environment variables as 'name=value' pairs
-h, --help help for link
-n, --name string Link name
-t, --target string Name of the component or capability to link to
-k, --type string Link type. Possible values: Env,Secret
hal link -n backend-to-db -t fruit-backend-sb -k Secret
Selected Change default name: backend-to-db
✓ Created link backend-to-db
As oc, kubectl client support to display a more verbose response using the parameter -v, --v=0: log level for V logs
, I propose that hal
also include such option to report more verbose message when by example we can't upload code source as we get an exit 1: error message
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.