mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-09 10:47:35 +00:00
Merge pull request #21 from pmorie/dev-deploy
Streamline dev deployment
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Binaries for programs and plugins
|
||||
registration
|
||||
dev-kubeconfig
|
||||
*.exe
|
||||
*.dll
|
||||
*.so
|
||||
|
||||
13
Makefile
13
Makefile
@@ -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
|
||||
|
||||
16
README.md
16
README.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user