Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Support for local kind cluster #190

Merged
merged 10 commits into from
Aug 14, 2023
Merged

Support for local kind cluster #190

merged 10 commits into from
Aug 14, 2023

Conversation

nstogner
Copy link
Contributor

@nstogner nstogner commented Aug 12, 2023

Add local kind support.

See Diagram

Fixes #152

Comment on lines +54 to +79
if _, err := io.Copy(f, r); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reaching a bit here but is it better to os.Stat(dst) the destination before copying so as to not overwrite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think overwriting the stored tarball is what we do in the real buckets today

Copy link
Contributor

@brandonjbjelland brandonjbjelland Aug 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overwriting the stored tarball is what we do in the real buckets today

Huh - I bet we have a not-so-subtle bug on GCP where one user could easily overwrite another's before the builder can start a build against it. LMK if I'm thinking about that wrong. If not, I'll create an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you thinking two users could both be running kubectl notebook -d . on the same Notebook at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, we are not currently accounting for that. Notebooks are intended to be used by 1 user at a time at the moment.

@nstogner nstogner changed the title WIP: Support for local kind cluster Support for local kind cluster Aug 13, 2023
cmd/sci-kind/main.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated
@@ -257,7 +283,8 @@ installation-scripts:
installation-manifests: manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
cd config/gcpmanager && $(KUSTOMIZE) edit set image gcp-manager=${IMG_GCPMANAGER}
$(KUSTOMIZE) build config/default > install/kubernetes/system.yaml
$(KUSTOMIZE) build config/install-gcp > install/kubernetes/system.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change this to install/kubernetes/gcp/system.yaml in my PR or you can do it here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets merge your PR 1st

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am now in favor of merging my PR first. I tested it very thoroughly and feel it's ready. Let's discuss more offline.

Copy link
Contributor

@brandonjbjelland brandonjbjelland Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's become necessary at this point. I don't think we'll end up in this state in the future (developing multiple SCIs at once) but I think we can avoid this if we worked in smaller chunks as PRs (SCI -> SCI implementation -> deployment bits -> lastly the controller integration). The last piece would be the only part blocked by unfinished-implementations.

config/install-kind/manager_patch.yaml Outdated Show resolved Hide resolved
config/registry-kind/configmap.yaml Show resolved Hide resolved
@@ -0,0 +1,12 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be included by default in all installation not just kind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done this in my PR/branch for now as well: 01d2ec1

Approach I took is add namespace.yaml under config/manager. I thought it wasn't worth creating a separate directory.

config/sci-kind/deployment.yaml Outdated Show resolved Hide resolved
config/sci-kind/service.yaml Outdated Show resolved Hide resolved
internal/cloud/kind.go Outdated Show resolved Hide resolved
fi
nsenter --target 1 --mount bash -c "systemctl is-active --quiet containerd && echo 'Restarting containerd' && systemctl restart containerd"
# Wait for containerd to be ready so that skaffold doesn't fail.
nsenter --target 1 --mount bash -c "while ! ctr -n k8s.io containers ls; do sleep 1; done"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably can be removed

@nstogner nstogner merged commit 75467f6 into main Aug 14, 2023
4 checks passed
@nstogner nstogner deleted the kind branch August 14, 2023 18:25
@samos123 samos123 restored the kind branch August 22, 2023 05:38
@samos123 samos123 deleted the kind branch August 22, 2023 06:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local kind cluster installation
3 participants