Merge pull request #21 from pmorie/dev-deploy

Streamline dev deployment
This commit is contained in:
OpenShift Merge Robot
2020-05-08 18:04:35 +02:00
committed by GitHub
3 changed files with 17 additions and 13 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
# Binaries for programs and plugins
registration
dev-kubeconfig
*.exe
*.dll
*.so

View File

@@ -11,6 +11,7 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
)
IMAGE_REGISTRY?=quay.io
KUBECONFIG ?= ./.kubeconfig
$(call add-bindata,spokecluster,./pkg/hub/spokecluster/manifests/...,bindata,bindata,./pkg/hub/spokecluster/bindata/bindata.go)
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
@@ -29,9 +30,21 @@ clean:
deploy-hub:
kustomize build deploy/hub | kubectl apply -f -
cluster-ip:
CLUSTER_IP?=$(shell kubectl get svc kubernetes -n default -o jsonpath="{.spec.clusterIP}")
bootstrap-secret: cluster-ip
cp $(KUBECONFIG) dev-kubeconfig
kubectl config set clusters.kind-kind.server https://$(CLUSTER_IP) --kubeconfig dev-kubeconfig
kubectl create secret generic bootstrap-secret --from-file=kubeconfig=dev-kubeconfig -n open-cluster-management
deploy-spoke:
kustomize build deploy/spoke | kubectl apply -f -
# test-e2e target is currently a NOP that deploys the hub and self-joins the
# hosting cluster to itself as a spoke; it will be used to prototype e2e in ci.
test-e2e: deploy-hub bootstrap-secret deploy-spoke
GO_TEST_PACKAGES :=./pkg/... ./cmd/...
include ./test/integration-test.mk

View File

@@ -24,24 +24,14 @@ You can reach the maintainers of this project at:
Check the [Development Doc](docs/development.md) for how to contribute to the repo.
## How to Deploy
### Deploy Hub
1. Run `make deploy-hub`
### Deploy Spoke
1. Create a bootstrap kubeconfig secret in the namespace of `open-cluster-management`.
Ensure the server field in kubeconfig is accesible from cluster.
In a kind environment where hub and spoke component is deployed in one cluster, default kubernetes cluster ip can be used.
```sh
cp ~/.kube/config /<path>/kubeconfig
clusterIP=$(kubectl get svc kubernetes -n default -o jsonpath="{.spec.clusterIP}")
kubectl config set clusters.kind-kind.server https://$clusterIP --kubeconfig /<path>/kubeconfig
```
Then run the following command
```sh
kubectl create secret generic bootstrap-secret --from-file=kubeconfig=/<path>/kubeconfig -n open-cluster-management
```
1. Run `make bootstrap-secret`
2. Run `make deploy-spoke`
## Security Response