-
Notifications
You must be signed in to change notification settings - Fork 748
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
Use dockershim.sock for CRI #751
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ require ( | |
github.com/json-iterator/go v1.1.5 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | ||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect | ||
github.com/onsi/ginkgo v1.8.0 | ||
github.com/onsi/gomega v1.5.0 | ||
github.com/onsi/ginkgo v1.8.0 // indirect | ||
github.com/onsi/gomega v1.5.0 // indirect | ||
github.com/operator-framework/operator-sdk v0.0.7 | ||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect | ||
github.com/pkg/errors v0.8.1 | ||
|
@@ -40,7 +40,6 @@ require ( | |
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 | ||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 | ||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect | ||
google.golang.org/appengine v1.4.0 // indirect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm. this is likely due to different Golang versions in our local development environments trampling on each other... My local go version is 1.12.7. I suspect you're on 1.13 and beyond? |
||
google.golang.org/grpc v1.23.1 | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
k8s.io/api v0.0.0-20180712090710-2d6f90ab1293 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,14 +334,14 @@ func (c *IPAMContext) nodeInit() error { | |
} | ||
} | ||
localPods, err := c.getLocalPodsWithRetry() | ||
log.Debugf("getLocalPodsWithRetry() found %d local pods", len(localPods)) | ||
if err != nil { | ||
log.Warnf("During ipamd init, failed to get Pod information from Kubernetes API Server %v", err) | ||
ipamdErrInc("nodeInitK8SGetLocalPodIPsFailed") | ||
// This can happens when L-IPAMD starts before kubelet. | ||
// TODO need to add node health stats here | ||
return errors.Wrap(err, "failed to get running pods!") | ||
} | ||
log.Debugf("getLocalPodsWithRetry() found %d local pods", len(localPods)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good move... |
||
|
||
rules, err := c.networkClient.GetRuleList() | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,16 @@ package cri | |
import ( | ||
"context" | ||
"errors" | ||
|
||
"google.golang.org/grpc" | ||
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" | ||
"os" | ||
|
||
log "github.com/cihub/seelog" | ||
) | ||
|
||
const ( | ||
criSocketPath = "unix:///var/run/cri.sock" | ||
dockerSocketPath = "unix:///var/run/dockershim.sock" | ||
) | ||
|
||
// SandboxInfo provides container information | ||
|
@@ -33,7 +34,12 @@ func New() *Client { | |
} | ||
|
||
func (c *Client) GetRunningPodSandboxes() (map[string]*SandboxInfo, error) { | ||
conn, err := grpc.Dial(criSocketPath, grpc.WithInsecure()) | ||
socketPath := dockerSocketPath | ||
if info, err := os.Stat("/var/run/cri.sock"); err == nil && !info.IsDir() { | ||
socketPath = criSocketPath | ||
} | ||
log.Debugf("Getting running pod sandboxes from %q", socketPath) | ||
conn, err := grpc.Dial(socketPath, grpc.WithInsecure()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose we can turn this into a blocking call (WithBlock() with a backoff timeout) in a future commit... |
||
if err != nil { | ||
return nil, err | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ fi | |
|
||
AGENT_LOG_PATH=${AGENT_LOG_PATH:-aws-k8s-agent.log} | ||
HOST_CNI_BIN_PATH=${HOST_CNI_BIN_PATH:-/host/opt/cni/bin} | ||
HOST_CNI_CONFDIR_PATH=${HOST_CNI_CONFDIR_PATH:-/host/opt/cni/net.d} | ||
HOST_CNI_CONFDIR_PATH=${HOST_CNI_CONFDIR_PATH:-/host/etc/cni/net.d} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gahhhhhh! |
||
|
||
# Checks for IPAM connectivity on localhost port 50051, retrying connectivity | ||
# check with a timeout of 36 seconds | ||
|
@@ -53,7 +53,7 @@ wait_for_ipam() { | |
} | ||
|
||
echo -n "starting IPAM daemon in background ... " | ||
./aws-k8s-agent > $AGENT_LOG_PATH 2>&1 & | ||
./aws-k8s-agent > "$AGENT_LOG_PATH" 2>&1 & | ||
echo "ok." | ||
|
||
echo -n "checking for IPAM connectivity ... " | ||
|
@@ -68,13 +68,13 @@ echo "ok." | |
|
||
echo -n "copying CNI plugin binaries and config files ... " | ||
|
||
cp portmap $HOST_CNI_BIN_PATH | ||
cp aws-cni $HOST_CNI_BIN_PATH$ | ||
cp aws-cni-support.sh $HOST_CNI_BIN_PATH | ||
cp portmap "$HOST_CNI_BIN_PATH" | ||
cp aws-cni "$HOST_CNI_BIN_PATH" | ||
cp aws-cni-support.sh "$HOST_CNI_BIN_PATH" | ||
|
||
sed -i s/__VETHPREFIX__/"${AWS_VPC_K8S_CNI_VETHPREFIX:-"eni"}"/g 10-aws.conflist | ||
sed -i s/__MTU__/"${AWS_VPC_ENI_MTU:-"9001"}"/g 10-aws.conflist | ||
cp 10-aws.conflist $HOST_CNI_CONFDIR_PATH | ||
cp 10-aws.conflist "$HOST_CNI_CONFDIR_PATH" | ||
|
||
echo " ok." | ||
|
||
|
@@ -84,8 +84,8 @@ fi | |
|
||
# bring the aws-k8s-agent process back into the foreground | ||
echo "foregrounding IPAM daemon ... " | ||
fg %1 >/dev/null 2>&1 || $(echo "failed (process terminated)" && cat $AGENT_LOG_PATH && exit 1) | ||
fg %1 >/dev/null 2>&1 || $(echo "failed (process terminated)" && cat "$AGENT_LOG_PATH" && exit 1) | ||
|
||
# Best practice states we should send the container's CMD output to stdout, so | ||
# let's tee back up the log file into stdout | ||
cat $AGENT_LOG_PATH | ||
cat "$AGENT_LOG_PATH" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting that quote-encapping the variable in the entrypoint.sh script fixed anything here and above. I know it's safer to quote-encap vars but I'm curious whether this was an actual fix for a problem in the script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't, but we were mixing quoted and unquoted, so I just made it consistent. |
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.
interesting. this was a problem?
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.
Yeah, for some reason I got an error applying the config without the quotes.