Skip to content

Commit cc0331d

Browse files
author
Oleg Sucharevich
authored
Revert 1.x.x
* Revert "fix agent uninstall (#90)" This reverts commit ef3b241. Revert "replace @ char in context name (#89)" This reverts commit 5b3684a. Revert "fix title of steps" This reverts commit 53a6651. Revert "set branch name on codefresh run cmd" This reverts commit 01bdbea. Revert "fix agent references in test agent yaml" This reverts commit 397cf1a. Revert "fix agent test yaml" This reverts commit d44a327. Revert "Saas 5009 (#88)" This reverts commit 70510f3. * update version
1 parent ef3b241 commit cc0331d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+855
-1950
lines changed

.codefresh/codefresh.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ steps:
2222
commands:
2323
- export VERSION=$(jq -r ".version" package.json)
2424
- cf_export VERSION
25+
# - export FILE_VERSION= $(cat ./venonactl/VERSION)
2526
- cf_export FILE_VERSION=$(cat ./venonactl/VERSION)
2627
when:
2728
steps:

.codefresh/test-agent.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rules:
2323
semi:
2424
- error
2525
- always
26-
"jest/no-disabled-tests": "error"
26+
"jest/no-disabled-tests": "warn"
2727
"jest/no-focused-tests": "error"
2828
"jest/no-identical-title": "error"
2929
"jest/prefer-to-have-length": "warn"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ telepresence.log
1616
venonactl/dist/*
1717
venonactl-linux
1818
venonalog.json
19-
.venonaconf

README.md

Lines changed: 49 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,6 @@
22
[![Go Report Card](https://goreportcard.com/badge/github.com/codefresh-io/venona)](https://goreportcard.com/report/github.com/codefresh-io/venona)
33
[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/codefresh-inc/codefresh-io%2Fvenona%2Fvenona?type=cf-1)]( https://g.codefresh.io/public/accounts/codefresh-inc/pipelines/codefresh-io/venona/venona)
44

5-
## Version 1.x.x
6-
Version 1.0.0 is released now, read more about migration from older version [here](#Migration)
7-
We highly suggest to use [Codefresh official CLI](https://codefresh-io.github.io/cli/) to install the agent:
8-
```bash
9-
kubectl create namespace codefresh
10-
codefresh install agent --kube-namespace codefresh --install-runtime
11-
```
12-
13-
The last command will:
14-
1. Install the agent on the namespace `codefresh`
15-
2. Install the runtime on the same namespace
16-
3. Attach the runtime to the agent
17-
18-
It is still possible, for advanced users to install all manually, for example:
19-
One process of Venona can manage multiple runtime environments
20-
NOTE: Please make sure that the process where Venona is installed there is a network connection to the clusters where the runtimes will be installed
21-
```bash
22-
# 1. Create namespace for the agent:
23-
kubectl create namespace codefresh-agent
24-
25-
# 2. Install the agent on the namespace ( give your agent a unique):
26-
# Print a token that the Venona process will be using.
27-
codefresh create agent $NAME
28-
codefresh install agent --token $TOKEN --kube-namespace codefresh-agent
29-
30-
# 3. Create namespace for the first runtime:
31-
kubectl create namespace codefresh-runtime-1
32-
33-
# 4. Install the first runtime on the namespace
34-
# 5. the runtime name is printed
35-
codefresh install runtime --kube-namespace codefresh-runtime-1
36-
37-
# 6. Attach the first runtime to agent:
38-
codefresh attach runtime --agent-name $AGENT_NAME --agent-kube-namespace codefresh-agent --runtime-name $RUNTIME_NAME --kube-namespace codefresh-runtime-1
39-
40-
# 7. Restart the venona pod in namespace `codefresh-agent`
41-
kubectl delete pods $VENONA_POD
42-
43-
# 8. Create namespace for the second runtime
44-
kubectl create namespace codefresh-runtime-2
45-
46-
# 9. Install the second runtime on the namespace
47-
codefresh install runtime --kube-namespace codefresh-runtime-2
48-
49-
# 10. Attach the second runtime to agent and restart the Venoa pod automatically
50-
codefresh attach runtime --agent-name $AGENT_NAME --agent-kube-namespace codefresh-agent --runtime-name $RUNTIME_NAME --runtime-kube-namespace codefresh-runtime-1 --restart-agent
51-
52-
```
53-
54-
## Migration
55-
Migrating from Venona `< 1.x.x` to `> 1.x.x` is not done automatically, please use the [migration script](https://github.com/codefresh-io/venona/blob/master/scripts/migration.sh) to do that, check out which environment variables are required to run it.
56-
```bash
57-
# This script comes to migrate old versions of Venona installation ( version < 1.x.x ) to new version (version >= 1.0.0 )
58-
# Please read carefully what the script does.
59-
# There will be a "downtime" in terms of your builds targeted to this runtime environment
60-
# Once the script is finished, all the builds during the downtime will start
61-
# The script will:
62-
# 1. Create new agent entity in Codefresh using Codefresh CLI - give it a name $CODEFRESH_AGENT_NAME, default is "codefresh"
63-
# 2. Install the agent on you cluster pass variables:
64-
# a. $VENONA_KUBE_NAMESPACE - required
65-
# b. $VENONA_KUBE_CONTEXT - default is current-context
66-
# c. $VENONA_KUBECONFIG_PATH - default is $HOME/.kube/config
67-
# 3. Attach runtime to the new agent (downtime ends) - pass $CODEFRESH_RUNTIME_NAME - required
68-
```
69-
70-
715
## Installation
726

737
### Prerequisite:
@@ -78,13 +12,42 @@ Migrating from Venona `< 1.x.x` to `> 1.x.x` is not done automatically, please u
7812
* [Codefresh](https://codefresh-io.github.io/cli/) - Used to create resource in Codefresh
7913
* Authenticated context exist under `$HOME/.cfconfig` or authenticate with [Codefesh CLI](https://codefresh-io.github.io/cli/getting-started/#authenticate)
8014

15+
8116
### Install venona
8217

8318
* Download [venona's](https://github.com/codefresh-io/venona/releases) binary
8419
* With homebrew:
8520
* `brew tap codefresh-io/venona`
8621
* `brew install venona`
87-
22+
* Create namespace where venona should run<br />
23+
> `kubectl create namespace codefresh-runtime`
24+
* Create *new* runtime-environment with Venona's agents installed <br />
25+
> `venona install --kube-namespace codefresh-runtime`
26+
* Get the status <br />
27+
> `venona status`
28+
> `kubectl get pods -n codefresh-runtime`
29+
30+
#### Install Options
31+
32+
| Option Argument | Type | Description |
33+
| -------------------- | -------- | --------------------------------------------------- |
34+
| --build-annotations | stringArray | The kubernetes metadata.annotations as "key=value" to be used by venona build resources (default is no node selector) |
35+
| --build-node-selector | string | The kubernetes node selector "key=value" to be used by venona build resources (default is no node selector) |
36+
| --cluster-name | string | cluster name (if not passed runtime-environment will be created cluster-less); this is a friendly name used for metadata does not need to match the literal cluster name. Limited to 20 Characters. |
37+
| --dry-run | boolean | Set to true to simulate installation |
38+
| -h, --help | boolean | help for install |
39+
| --in-cluster | boolean | Set flag if venona is been installed from inside a cluster |
40+
| --kube-context-name | string | Name of the kubernetes context on which venona should be installed (default is current-context) [$KUBE_CONTEXT] |
41+
| --kube-namespace | string |Name of the namespace on which venona should be installed [$KUBE_NAMESPACE] |
42+
| --kube-node-selector | string | The kubernetes node selector "key=value" to be used by venona resources (default is no node selector) |
43+
| --kubernetes-runner-type | boolean | Set the runner type to kubernetes (alpha feature) |
44+
| --only-runtime-environment | boolean | Set to true to onlky configure namespace as runtime-environment for Codefresh |
45+
| --runtime-environment | string | if --skip-runtime-installation set, will try to configure venona on current runtime-environment |
46+
| --set-default | boolean | Mark the install runtime-environment as default one after installation |
47+
| --skip-runtime-installation | boolean | Set flag if you already have a configured runtime-environment, add --runtime-environment flag with name |
48+
| --storage-class | string | Set a name of your custom storage class, note: this will not install volume provisioning components |
49+
| --tolerations | string | The kubernetes tolerations as JSON string to be used by venona resources (default is no tolerations). If prefixed with "@", loads from a file: @/tmp/tolerations.json |
50+
| --venona-version | string | Version of venona to install (default is the latest) |
8851

8952
#### Install on cluster version < 1.10
9053
* Make sure the `PersistentLocalVolumes` [feature gate](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/) is turned on
@@ -115,11 +78,27 @@ Each one has own RBAC needs and therefore, created roles(and cluster-roles)
11578
The resource descriptors are avaliable [here](https://github.com/codefresh-io/venona/tree/master/venonactl/templates/kubernetes)
11679
List of the resources that will be created
11780
* Agent (grouped by `/.*.venona.yaml/`)
118-
* `service-account.re.yaml` - The service account that the Venona pod will use to create the resource on the runtime namespace(the resoucre installed on the runtime namespace)
119-
* `role.re.yaml` - Allow to GET, CREATE and DELETE pods and persistentvolumeclaims
120-
* `role-binding.re.yaml` - The agent is spinning up pods and pvc, this biniding binds `role.venona.yaml` to `service-account.venona.yaml`
81+
* `service-account.venona.yaml` - The service account that the agent's pod will use at the end
12182
* `cluster-role-binding.venona.yaml` - The agent discovering K8S apis by calling to `openapi/v2`, this ClusterRoleBinding binds bootstraped ClusterRole by Kubernetes `system:discovery` to `service-account.venona.yaml`. This role has only permissions to make a GET calls to non resources urls
83+
* `role.venona.yaml` - Allow to GET, CREATE and DELETE pods and persistentvolumeclaims
84+
* `role-binding.venona.yaml` - The agent is spinning up pods and pvc, this biniding binds `role.venona.yaml` to `service-account.venona.yaml`
12285
* Runtime-environment (grouped by `/.*.re.yaml/`) Kubernetes controller that spins up all required resources to provide a good caching expirience during pipeline execution
12386
* `service-account.dind-volume-provisioner.re.yaml` - The service account that the controller will use
12487
* `cluster-role.dind-volume-provisioner.re.yaml` Defines all the permission needed for the controller to operate correctly
12588
* `cluster-role-binding.dind-volume-provisioner.yaml` - Binds the ClusterRole to `service-account.dind-volume-provisioner.re.yaml`
89+
90+
### Access the cluster from executed pipeline
91+
After a successfull installation of Venona, you'll be able to run a Codefresh pipeline on the configured cluster.
92+
However, the pipeline itself dosent have any permission to connect to the hosted cluster.
93+
To make it work you need to add the cluster to Codefresh (make sure the service acount has all the permissions you need)
94+
> codefresh create cluster --kube-context CONTEXT_NAME --namespace NAMESPACE --serviceaccount SERVICE_ACCOUNT --behind-firewall
95+
96+
#### Upgrade
97+
To upgrade existing runtime-environment, a one that was created without Venona's agent, run:
98+
* Find the name of the cluster was linked to that runtime environment <br />
99+
Example: `codefresh get cluster`
100+
* Install <br />
101+
Example: `venona install --cluster-name CLUSTER`
102+
* Get the status <br />
103+
Example: `venona status RUNTIME-ENVIRONMENT`
104+
Example: `kubectl get pods -n NAMESPACE`

__mocks__/recursive-readdir.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)