Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minikube to create volume snapshot development environment locally #2228

Merged
merged 5 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/dockers-dev-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@ on:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
pull_request:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
pull_request_target:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-dev-container-image.yml"
- "dockers/ci/**"
- "dockers/dev/**"
- "Makefile"
- "Makefile.d/**"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
schedule:
- cron: "0 1 * * *"

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,4 @@ include Makefile.d/kind.mk
include Makefile.d/proto.mk
include Makefile.d/test.mk
include Makefile.d/tools.mk
include Makefile.d/minikube.mk
42 changes: 42 additions & 0 deletions Makefile.d/minikube.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]>
#
# 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
#
# https://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.
#
.PHONY: minikube/install
minikube/install: $(BINDIR)/minikube

$(BINDIR)/minikube:
mkdir -p $(BINDIR)
curl -L https://storage.googleapis.com/minikube/releases/latest/minikube-$(shell echo $(UNAME) | tr '[:upper:]' '[:lower:]')-$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/minikube
chmod a+x $(BINDIR)/minikube

# Start minikube with CSI Driver and Volume Snapshots support
# Only use this for development related to Volume Snapshots. Usually k3d is faster.
.PHONY: minikube/start
minikube/start:
minikube start --force
minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver
minikube addons disable storage-provisioner
minikube addons disable default-storageclass
kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

.PHONY: minikube/delete
minikube/delete:
minikube delete

.PHONY: minikube/restart
minikube/restart:
@make minikube/delete
@make minikube/start
6 changes: 2 additions & 4 deletions Makefile.d/proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ proto/deps: \
$(GOPATH)/src/github.com/planetscale/vtprotobuf \
$(GOPATH)/src/github.com/protocolbuffers/protobuf \
$(GOPATH)/src/google.golang.org/genproto \
$(GOPATH)/src/google.golang.org/protobuf \
$(ROOTDIR)/apis/proto/v1/rpc/error_details.proto
$(GOPATH)/src/google.golang.org/protobuf

.PHONY: proto/clean/deps
## uninstall all protobuf dependencies
Expand All @@ -79,8 +78,7 @@ proto/clean/deps:
$(GOPATH)/src/github.com/planetscale/vtprotobuf \
$(GOPATH)/src/github.com/protocolbuffers/protobuf \
$(GOPATH)/src/google.golang.org/genproto \
$(GOPATH)/src/google.golang.org/protobuf \
$(ROOTDIR)/apis/proto/v1/rpc/error_details.proto
$(GOPATH)/src/google.golang.org/protobuf


$(GOPATH)/src/github.com/protocolbuffers/protobuf:
Expand Down
3 changes: 2 additions & 1 deletion dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ RUN make deps \
# additional deps
RUN make k3d/install \
&& make buf/install \
&& make k9s/install
&& make k9s/install \
&& make minikube/install
Loading