Skip to content

Commit 46b2138

Browse files
author
Corneil du Plessis
committed
[CI] Update carvel documentation
1 parent d911710 commit 46b2138

20 files changed

+1454
-68
lines changed

spring-cloud-dataflow-docs/src/main/asciidoc/configuration-carvel.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
:source-highlighter: rouge
21
[[configuration-carvel]]
32
== Deployment using Carvel
43

4+
Deployment of a carvel package requires the installation of tools and specific Kubernetes controllers. Then you will add the package repository to the cluster and install the application.
5+
56
== Required Tools
67

78
* `kubectl` - Kubernetes CLI (Install with `brew install kubectl`)
@@ -37,8 +38,8 @@ These scripts assume you are connected to a Kubernetes cluster and `kubectl` is
3738
|Name | Arguments |Descriptions
3839

3940
| start-deploy.sh
40-
| <broker> [scdf-type] [namespace]
41-
| Configures environmental variables needs for the rest of the scripts. `BROKER`, `NS` and `SCDF_TYPE` are set. The default `NS` is `scdf`. The namespace will be created if it doesn't exist by `setup-scdf-repo.sh`. The default `SCDF_TYPE` is `oss`
41+
| <broker> [scdf-type] [namespace] [release\|snapshot]
42+
| Configures environmental variables needs for the rest of the scripts. `BROKER`, `NS` and `SCDF_TYPE` are set. The default `NS` is `scdf`. The namespace will be created if it doesn't exist by `setup-scdf-repo.sh`. The default `SCDF_TYPE` is `oss`. _release\|snapshot_ and _scdf-type_ will determine the value of `PACKAGE_VERSION` set.
4243

4344
| prepare-cluster.sh
4445
| N/A
@@ -95,14 +96,15 @@ Executing the following script will configure the environmental variables needed
9596

9697
[source,shell]
9798
....
98-
source ./start-deploy.sh <broker> <namespace> [scdf-type]
99+
source ./start-deploy.sh <broker> <namespace> [scdf-type] [release\|snapshot]
99100
....
100101

101102
Where:
102103

103104
* `broker` is one of rabbitmq or kafka
104105
* `namespace` A valid Kubernetes namespace other than `default`
105106
* `scdf-type` One of oss or pro. oss is the default.
107+
* `release\|snapshot` and `scdf-type` will determine the value of `PACKAGE_VERSION`.
106108

107109

108110
The environmental variables can also be configured manually to override the values.

spring-cloud-dataflow-package/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616
<groupId>org.apache.maven.plugins</groupId>
1717
<artifactId>maven-assembly-plugin</artifactId>
1818
<version>3.5.0</version>
19+
<executions>
20+
<execution>
21+
<phase>package</phase>
22+
<goals>
23+
<goal>single</goal>
24+
</goals>
25+
<configuration>
26+
<appendAssemblyId>false</appendAssemblyId>
27+
<descriptors>
28+
<descriptor>src/main/assembly/zip.xml</descriptor>
29+
</descriptors>
30+
</configuration>
31+
</execution>
32+
</executions>
1933
</plugin>
2034
</plugins>
2135
</build>

spring-cloud-dataflow-package/scr/assembly/assembly.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 https://maven.apache.org/xsd/assembly-2.1.1.xsd">
4+
<id>distribution</id>
5+
<includeBaseDirectory>false</includeBaseDirectory>
6+
<formats>
7+
<format>tar.gz</format>
8+
</formats>
9+
<fileSets>
10+
<fileSet>
11+
<directory>${project.basedir}/../src/deploy</directory>
12+
<outputDirectory>deploy</outputDirectory>
13+
<excludes>
14+
<exclude>*.adoc</exclude>
15+
</excludes>
16+
</fileSet>
17+
<fileSet>
18+
<directory>${project.basedir}/../src/kubernetes</directory>
19+
<outputDirectory>deploy/kubernetes</outputDirectory>
20+
</fileSet>
21+
</fileSets>
22+
</assembly>

src/deploy/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Deployment to Kubernetes
22

3-
This document describes how to use the Carvel packages to deploy Spring Cloud Data Flow, and it also has a section on creating local development cluster using minikube or kind.
3+
This document describes how to use the Carvel packages to deploy Spring Cloud Data Flow, and it also has a xref:#local-k8s-development[section] on creating local development cluster using minikube or kind.
44

55
include::../../spring-cloud-dataflow-docs/src/main/asciidoc/configuration-carvel.adoc[]
66

src/deploy/README.html

Lines changed: 1318 additions & 0 deletions
Large diffs are not rendered by default.

src/deploy/README.pdf

214 KB
Binary file not shown.

src/deploy/carvel/carvel-prepare-namespaces.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ check_env NS
3030
kubectl create namespace $NS
3131
kubectl create namespace secrets-ns
3232
$SCDIR/add-roles.sh "system:aggregate-to-edit" "system:aggregate-to-admin" "system:aggregate-to-view"
33-
PRESENT=$(kubectl get serviceaccount --namespace $NS --output=json | count_kind serviceaccount "$NS-sa")
33+
PRESENT=$(kubectl get serviceaccount --namespace $NS --output=json | count_kind serviceaccount "$SA")
3434
if ((PRESENT > 0)); then
3535
kubectl delete serviceaccount "$SA" --namespace $NS
3636
fi

src/deploy/carvel/configure-database.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
if [ "$DEBUG" == "true" ]; then
33
echo "DEBUG: configure-database.sh $*"
44
fi
5-
65
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
76
if [ "$4" = "" ]; then
87
echo "<app> <database> <url> <username/secret-name> [password/secret-username-key] [secret-password-key]"

src/deploy/carvel/delete-scdf.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,21 @@ function check_env() {
1212
fi
1313
}
1414
check_env NS
15-
16-
if [ "$SCDF_TYPE" == "" ]; then
17-
SCDF_TYPE=pro
18-
fi
15+
check_env PACKAGE_VERSION
1916
if [ "$1" != "" ]; then
2017
SCDF_TYPE=$1
2118
fi
19+
check_env SCDF_TYPE
2220

2321
case $SCDF_TYPE in
2422
"pro")
2523
APP_NAME=scdf-pro-app
26-
PACKAGE_VERSION=1.5.3-SNAPSHOT
2724
PACKAGE_NAME=scdf-pro.tanzu.vmware.com
2825
REGISTRY=dev.registry.pivotal.io
2926
REPO_NAME="p-scdf-for-kubernetes/scdf-pro-repo"
3027
;;
3128
"oss")
3229
APP_NAME=scdf-oss-app
33-
PACKAGE_VERSION=2.11.0-SNAPSHOT
3430
PACKAGE_NAME=scdf.tanzu.vmware.com
3531
REGISTRY=index.docker.io
3632
REPO_NAME="springcloud/scdf-oss-repo"

src/deploy/carvel/deploy-local-broker.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
function count_kind() {
36
jq --arg kind $1 --arg name $2 '.items | .[] | select(.kind == $kind) | .metadata | select(.name == $name) | .name' | grep -c -F "$2"
47
}
@@ -22,8 +25,10 @@ case $BROKER in
2225
exit 1
2326
;;
2427
esac
25-
26-
K8S=$(realpath $SCDIR/../../kubernetes)
28+
K8S=$(realpath $SCDIR/../kubernetes)
29+
if [ ! -d "$K8S" ]; then
30+
K8S=$(realpath $SCDIR/../../kubernetes)
31+
fi
2732
$SCDIR/prepare-local-namespace.sh "$BROKER-sa" $BROKER
2833
kubectl create --namespace $BROKER -f $K8S/$BROKER/
2934
if [ "$BROKER" = "rabbitmq" ]; then
@@ -39,7 +44,7 @@ export BROKER
3944
yq ".scdf.binder.type=\"$BINDER_NAME\"" -i ./scdf-values.yml
4045

4146
if [ "$BROKER" = "rabbitmq" ]; then
42-
yq ".scdf.binder.rabbit.host=\"rabbitmq\"" -i ./scdf-values.yml
47+
yq ".scdf.binder.rabbit.host=\"rabbitmq.rabbitmq\"" -i ./scdf-values.yml
4348
yq ".scdf.binder.rabbit.port=5672" -i ./scdf-values.yml
4449
else
4550
yq ".scdf.binder.type=\"kafka\"" -i ./scdf-values.yml

src/deploy/carvel/deploy-local-database.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
36
start_time=$(date +%s)
47
if [ "$1" = "" ]; then
@@ -18,7 +21,10 @@ case $1 in
1821
;;
1922
esac
2023

21-
K8S=$(realpath $SCDIR/../../kubernetes)
24+
K8S=$(realpath $SCDIR/../kubernetes)
25+
if [ ! -d "$K8S" ]; then
26+
K8S=$(realpath $SCDIR/../../kubernetes)
27+
fi
2228
set +e
2329
$SCDIR/prepare-local-namespace.sh "$DATABASE-sa" $DATABASE
2430

src/deploy/carvel/deploy-local-prometheus.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
36
start_time=$(date +%s)
4-
K8S=$(realpath $SCDIR/../../kubernetes)
7+
K8S=$(realpath $SCDIR/../kubernetes)
8+
if [ ! -d "$K8S" ]; then
9+
K8S=$(realpath $SCDIR/../../kubernetes)
10+
fi
511

612
$SCDIR/prepare-local-namespace.sh prometheus prometheus
713
kubectl create serviceaccount prometheus-rsocket-proxy --namespace prometheus

src/deploy/carvel/deploy-scdf.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
5+
function check_env() {
6+
eval ev='$'$1
7+
if [ "$ev" == "" ]; then
8+
echo "env var $1 not defined"
9+
if ((sourced != 0)); then
10+
return 1
11+
else
12+
exit 1
13+
fi
14+
fi
15+
}
16+
if [ "$SCDF_TYPE" == "" ]; then
17+
echo "Environmental variable SCDF_TYPE must be set to one of oss or pro."
18+
fi
19+
check_env NS
20+
check_env PACKAGE_VERSION
221
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
322
start_time=$(date +%s)
423
# the following names are your choice.
5-
if [ "$NS" = "" ]; then
6-
echo "Expected env var NS"
7-
exit 1
8-
fi
24+
925
COUNT=$(kubectl get namespace $NS | grep -c "$NS")
1026
if ((COUNT == 0)); then
1127
echo "Expected namespace $NS"
@@ -14,23 +30,13 @@ else
1430
echo "Namespace $NS exists"
1531
fi
1632

17-
if [ "$SCDF_TYPE" == "" ]; then
18-
echo "SCDF_TYPE must be set to one of oss or pro."
19-
fi
20-
2133
case $SCDF_TYPE in
2234
"pro")
2335
APP_NAME=scdf-pro-app
24-
if [ "$PACKAGE_VERSION" = "" ]; then
25-
PACKAGE_VERSION=1.6.0-SNAPSHOT
26-
fi
2736
PACKAGE_NAME=scdf-pro.tanzu.vmware.com
2837
;;
2938
"oss")
3039
APP_NAME=scdf-oss-app
31-
if [ "$PACKAGE_VERSION" = "" ]; then
32-
PACKAGE_VERSION=2.11.0-SNAPSHOT
33-
fi
3440
PACKAGE_NAME=scdf.tanzu.vmware.com
3541
;;
3642
*)

src/deploy/carvel/prepare-cluster.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
CM_VERSION=v1.11.1
36
SGC_VER=v0.14.2
47
KC_VER=v0.45.0

src/deploy/carvel/register-apps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
36
start_time=$(date +%s)
47
function register_app() {

src/deploy/carvel/setup-scdf-repo.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
function check_env() {
36
eval ev='$'$1
47
if [ "$ev" == "" ]; then
@@ -16,6 +19,7 @@ start_time=$(date +%s)
1619
# the following names are your choice.
1720
check_env NS
1821
check_env SCDF_TYPE
22+
check_env PACKAGE_VERSION
1923
check_env DOCKER_HUB_USERNAME
2024
check_env DOCKER_HUB_PASSWORD
2125

@@ -24,9 +28,6 @@ $SCDIR/carvel-prepare-namespaces.sh $NS
2428

2529
case $SCDF_TYPE in
2630
"pro")
27-
if [ "$PACKAGE_VERSION" = "" ]; then
28-
PACKAGE_VERSION=1.6.0-SNAPSHOT
29-
fi
3031
PACKAGE_NAME=scdf-pro.tanzu.vmware.com
3132
if [ "$PACKAGE_REPO" = "" ]; then
3233
PACKAGE_REPO="dev.registry.pivotal.io/p-scdf-for-kubernetes"
@@ -36,9 +37,6 @@ case $SCDF_TYPE in
3637
fi
3738
;;
3839
"oss")
39-
if [ "$PACKAGE_VERSION" = "" ]; then
40-
PACKAGE_VERSION=2.11.0-SNAPSHOT
41-
fi
4240
PACKAGE_NAME=scdf.tanzu.vmware.com
4341
if [ "$PACKAGE_REPO" = "" ]; then
4442
PACKAGE_REPO="index.docker.io/springcloud"

src/deploy/carvel/start-deploy.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
11
#!/usr/bin/env bash
2+
bold="\033[1m"
3+
dim="\033[2m"
4+
end="\033[0m"
25
(return 0 2>/dev/null) && sourced=1 || sourced=0
36
if [ "$sourced" = "0" ]; then
47
echo "This script must be invoked using: source $0 $*"
58
exit 1
69
fi
710
if [ "$1" = "" ]; then
8-
echo "Usage: <broker> [scdf-type] [namespace]"
11+
echo "Usage: <broker> [scdf-type] [namespace] [release|snapshot]"
912
echo "Where:"
1013
echo " broker is one of kafka or rabbitmq"
1114
echo " scdf-type is one of oss or pro. The default is 'oss'"
1215
echo " namespace is a valid k8s namespace other than 'default'. The default is 'scdf'."
16+
echo " release or snapshot and scdf-type will determine PACKAGE_VERSION. The default is latest snapshot."
1317
return 0
1418
fi
15-
DATABASE=postgresql
19+
1620
SCDF_TYPE=oss
1721
NS=scdf
22+
1823
while [ "$1" != "" ]; do
1924
case $1 in
25+
"snapshot")
26+
if [ "$SCDF_TYPE" = "oss" ]; then
27+
PACKAGE_VERSION=2.11.0-SNAPSHOT
28+
else
29+
PACKAGE_VERSION=1.6.0-SNAPSHOT
30+
fi
31+
export PACKAGE_VERSION
32+
;;
33+
"release")
34+
if [ "$SCDF_TYPE" = "oss" ]; then
35+
PACKAGE_VERSION=2.10.3
36+
else
37+
PACKAGE_VERSION=1.5.3
38+
fi
39+
export PACKAGE_VERSION
40+
;;
2041
"rabbitmq" | "rabbit")
2142
BROKER=rabbitmq
2243
;;
@@ -44,6 +65,13 @@ fi
4465
export BROKER
4566
export SCDF_TYPE
4667
export NS
68+
4769
echo "Broker: $BROKER"
4870
echo "SCDF Type: $SCDF_TYPE"
71+
if [ "$PACKAGE_VERSION" = "" ]; then
72+
echo "Package version: N/A"
73+
echo -e "${bold}Configure environmental variable PACKAGE_VERSION to specific value.${end}"
74+
else
75+
echo "Package version: $PACKAGE_VERSION"
76+
fi
4977
echo "NS: $NS"

0 commit comments

Comments
 (0)