You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2018/09/28 13:00:56 UTC

[camel-k] 03/06: Add make install-minikube command

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ba8224a114cf3d2045bef08606a8cb1c530a0fa8
Author: nferraro <ni...@gmail.com>
AuthorDate: Fri Sep 28 12:45:22 2018 +0200

    Add make install-minikube command
---
 build/Makefile            |  3 +++
 build/install_minikube.sh | 14 ++++++++++++++
 deploy/resources.go       | 41 ++++++++++++++++++++++++++++++++++++++++-
 docs/developers.adoc      | 14 ++++++++++++++
 4 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/build/Makefile b/build/Makefile
index 3bc099c..6c0ddbb 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -56,6 +56,9 @@ install: install-minishift
 install-minishift:
 	./build/install_minishift.sh
 
+install-minikube:
+	./build/install_minikube.sh
+
 test: check
 check:
 	go test ./...
diff --git a/build/install_minikube.sh b/build/install_minikube.sh
new file mode 100755
index 0000000..cc6a159
--- /dev/null
+++ b/build/install_minikube.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Exit on error
+set -e
+
+# Compile and build images
+make
+eval $(minikube docker-env)
+make images
+
+# Perform installation
+./kamel install
+
+kubectl delete pod -l name=camel-k-operator || true
diff --git a/deploy/resources.go b/deploy/resources.go
index 39ab8ee..ea8fdb9 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -2206,7 +2206,7 @@ spec:
           .to('log:info?showHeaders=true')
     name: routes.groovy
 `
-	Resources["operator-deployment.yaml"] =
+	Resources["operator-deployment-kubernetes.yaml"] =
 		`
 apiVersion: apps/v1
 kind: Deployment
@@ -2252,6 +2252,45 @@ spec:
           claimName: camel-k-builder
 
 `
+	Resources["operator-deployment-openshift.yaml"] =
+		`
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: camel-k-operator
+  labels:
+    app: "camel-k"
+spec:
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      name: camel-k-operator
+  template:
+    metadata:
+      labels:
+        name: camel-k-operator
+    spec:
+      serviceAccountName: camel-k-operator
+      containers:
+        - name: camel-k-operator
+          image: docker.io/apache/camel-k:0.0.3-SNAPSHOT
+          ports:
+          - containerPort: 60000
+            name: metrics
+          command:
+          - camel-k-operator
+          imagePullPolicy: IfNotPresent
+          env:
+            - name: WATCH_NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+            - name: OPERATOR_NAME
+              value: "camel-k-operator"
+
+`
 	Resources["operator-role-binding.yaml"] =
 		`
 kind: RoleBinding
diff --git a/docs/developers.adoc b/docs/developers.adoc
index 06bb10a..ee329bd 100644
--- a/docs/developers.adoc
+++ b/docs/developers.adoc
@@ -114,11 +114,21 @@ make test-integration
 
 If you want to install everything you have in your source code and see it running on Kubernetes, you need to run the following command:
 
+=== For Minishift
+
 * Run `make install-minishift` (or just `make install`): to build the project and install it in the current namespace on Minishift
 * You can specify a different namespace with `make install-minishift project=myawesomeproject`
 
 This command assumes you have an already running Minishift instance.
 
+=== For Minikube
+
+* Run `make install-minikube`: to build the project and install it in the current namespace on Minikube
+
+This command assumes you have an already running Minikube instance.
+
+=== Use
+
 Now you can play with Camel K:
 
 ```
@@ -162,3 +172,7 @@ When configuring the IDE task, make sure to add all required environment variabl
 * Set the `OPERATOR_NAME` environment variable to `camel-k-operator`.
 
 After you setup the IDE task, you can run and debug the operator process.
+
+NOTE: The operator can be fully debugged in Minishift, because it uses OpenShift S2I binary builds under the hood.
+The build phase cannot be (currently) debugged in Minikube because the Kaniko builder requires that the operator and the publisher pod
+share a common persistent volume.