-
Notifications
You must be signed in to change notification settings - Fork 405
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
Allow images to be loaded into kind using 'kind.local'. #180
Conversation
69c0040
to
b82ee35
Compare
|
||
// Cause the pod to "hang" to allow us to check for a readiness state. | ||
sigs := make(chan os.Signal) | ||
signal.Notify(sigs, syscall.SIGTERM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have problems with Windows. Paging @evankanderson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking here, it looks like TERM is wrong on windows and we want Interrupt (for both): https://github.com/knative/pkg/blob/master/signals/signal_windows.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What setup do I need to run this test? I have Windows and I think I have Kind on there (I've been using the Docker k8s cluster recently, but have tried several).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evankanderson kind should be fine. Just running integration-tests.sh
should do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that .\integration-tests.sh
doesn't work at all unless you install WSL. 😁
I'm interpreting that into windows-ese now, as running in WSL2 isn't really what I think you meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not looking good:
where.exe ko | Get-Item
Directory: C:\Users\evank\go\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 9/4/2020 3:55 PM 45475328 ko.exe
apiVersion: v1
kind: Pod
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"kodata","namespace":"default"},"spec":{"containers":[{"image":"kind.local/test-0e3a563dcfe31cd0109fe43c1bf7c91e:07723e67f22e6166c482243cd364ce809e692ebfceeb5ac1fe6c1a6d8b533bac","name":"obiwan"}],"restartPolicy":"Never"}}
creationTimestamp: "2020-09-04T23:00:45Z"
name: kodata
namespace: default
resourceVersion: "460"
selfLink: /api/v1/namespaces/default/pods/kodata
uid: 5042f04f-ec41-4977-8277-1c2d3105a326
spec:
containers:
- image: kind.local/test-0e3a563dcfe31cd0109fe43c1bf7c91e:07723e67f22e6166c482243cd364ce809e692ebfceeb5ac1fe6c1a6d8b533bac
imagePullPolicy: IfNotPresent
name: obiwan
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-gmfbj
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
nodeName: kind-control-plane
priority: 0
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
volumes:
- name: default-token-gmfbj
secret:
defaultMode: 420
secretName: default-token-gmfbj
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2020-09-04T23:00:48Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2020-09-04T23:00:48Z"
message: 'containers with unready status: [obiwan]'
reason: ContainersNotReady
status: "False"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2020-09-04T23:00:48Z"
message: 'containers with unready status: [obiwan]'
reason: ContainersNotReady
status: "False"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2020-09-04T23:00:48Z"
status: "True"
type: PodScheduled
containerStatuses:
- containerID: containerd://093eaf8b2bb2b10597fc384baacdac2047144e59380ca403b1267952b53dd55d
image: kind.local/test-0e3a563dcfe31cd0109fe43c1bf7c91e:latest
imageID: sha256:86b4c2af5f8f1b04278bd8c20b04c4953826b146f7af0b86734f725117e36b82
lastState: {}
name: obiwan
ready: false
restartCount: 0
started: false
state:
terminated:
containerID: containerd://093eaf8b2bb2b10597fc384baacdac2047144e59380ca403b1267952b53dd55d
exitCode: 1
finishedAt: "2020-09-04T23:00:49Z"
reason: Error
startedAt: "2020-09-04T23:00:49Z"
hostIP: 172.17.0.2
phase: Failed
podIP: 10.244.0.2
podIPs:
- ip: 10.244.0.2
qosClass: BestEffort
startTime: "2020-09-04T23:00:48Z"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubectl logs output:
kubectl logs kodata
2020/09/04 23:00:49 ../kenobi
2020/09/04 23:00:49 Error reading "/var/run/ko/refs/heads/master": open /var/run/ko/refs/heads/master: not a directory
return pw.CloseWithError(tarball.Write(tag, img, pw)) | ||
}) | ||
|
||
cmd := n.Command("ctr", "--namespace=k8s.io", "images", "import", "-").SetStdin(pr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are going to run serially. I wonder about running onEachNode
in an errgroup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like complexity for a follow-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, I thought about that too but then wanted to get the general mechanism blessed first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this seems great. We should add kind.local
to the list of built-in domains that Serving ignores for digest resolution too 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that as soon as this lands 😂
@markusthoemmes Can you update the README to call this out? Generally this seems great. |
99168ea
to
bd401c9
Compare
Fixes #123
Fixes #149
This allows
ko
to load images into kind nodes when the user is setting theKO_DOCKER_REPO
tokind.local
.This replicates some of
kind
's CLI in that it talks to the container hosting the respective K8s node and loads an image into it byexec
ing into the containerd instance of the respective container and loading the image in via stdin.