diff --git a/README.md b/README.md index ac4da0fd..e6462187 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ $ git clone https://github.com/kubegene/kubegene.git We have provide the YAML file that contains all API objects that are necessary to run kubedag, you can easily deploy the kubedag using the follow commands: ```bash -$ kubectl create -f deploy/setup-kubedag.yaml +$ ./hack/local-up-kubedag.sh ``` kubedag will automatically create a Kubernetes Custom Resource Definition (CRD): diff --git a/deploy/clusterRole.yaml b/deploy/clusterRole.yaml index 29c89abb..7aa7cd41 100644 --- a/deploy/clusterRole.yaml +++ b/deploy/clusterRole.yaml @@ -17,4 +17,7 @@ rules: verbs: ["update", "patch"] - apiGroups: [""] resources: ["configmaps"] - verbs: ["create", "get", "list", "watch", "update", "delete"] \ No newline at end of file + verbs: ["create", "get", "list", "watch", "update", "delete"] + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] diff --git a/deploy/setup-kubedag.yaml b/deploy/setup-kubedag.yaml index 8f4afb03..d8de1a80 100644 --- a/deploy/setup-kubedag.yaml +++ b/deploy/setup-kubedag.yaml @@ -26,7 +26,10 @@ rules: - apiGroups: [""] resources: ["configmaps"] verbs: ["create", "get", "list", "watch", "update", "delete"] - + - apiGroups: [""] + resources: ["events"] + verbs: ["list", "watch", "create", "update", "patch"] + --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/hack/local-up-kubedag.sh b/hack/local-up-kubedag.sh new file mode 100755 index 00000000..522729da --- /dev/null +++ b/hack/local-up-kubedag.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Copyright 2018 The Kubegene Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is a simple script to deploy kubedag in local kubernetes cluster. + +set -o errexit +set -o nounset +set -o pipefail + +# compile kubedag +make kube-dag + +# build docker image +docker build -t kube-dag:v1 . + +# deploy kubedag +kubectl create -f ./deploy/setup-kubedag.yaml