Open sgandon opened 4 years ago
Hi @sgandon
Thank you for reporting this issue. I'm logging a work-item for our engineering team to investigate. I will post back to thread as soon as we have an update to share.
Thank you.
@sgandon, could you please send us the full log files? You can email it to me at ansoedal@microsoft.com if you feel most comfortable that way. Thanks!
@amsoedal I am not sure what king of other log I can provide, I only found 2 kind of files in the log folder and they are both (bridge-mindarocli.txt and bridge-library.xxxx.txt) displayed fully in the issue description. I will zip the complete folder and send it to you.
I got exactly the same error, while using Openshift CRC as local cluster.
Hi @faysou thanks for reporting this! Would you be able to upload/send your logs to BridgeToKubernetes@microsoft.com as well?
The logs can be found at: For Windows: %TEMP%/Bridge to Kubernetes For OSX/Linux: $TMPDIR/Bridge to Kubernetes
Thank you. I got the problem while debugging a Go app as well, I don't know if it's related, I'll try with another language to test.
I've sent you the two log files. Fingers crossed you can do something, I'm eager to test this extension, it seems amazing to accelerate developing microservices. On top of that it seems to be a language agnostic solution (but I'm not sure about this).
Also I've noticed that in this document https://github.com/microsoft/mindaro/tree/master/samples/todo-app
It says "You will be prompted to allow the EndpointManager to run elevated and modify your hosts file."
But I didn't get any prompt. I guess this is related to the "Failed to get elevation requests" error.
@faysou, thanks for sending your logs over. It looks like there's an SSL issue when we try to communicate with the cluster. Are you currently able to make calls to the kube-api using your kubeconfig? If so, is the kube-api server locked down a certain way using SSL? Also, what cluster provider are you using?
Thank you for your reply. I'm using a local Openshift CRC cluster in Windows. Usually I use the integrated oc cli from CRC. I'll try tomorrow what you suggest with kubeconfig.
I'm able to access the cluster with kubeconfig. I used this example in python : https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/
Maybe the dotnet code using by the Bridge to kubernetes extension expects some SSL security that is not present in a local dev cluster ? Although your documentation mentions that the extension works with minikube.
It's hard to know for me without being able to debug the extension.
@faysou thanks for the quick reply! Sorry if you've already done this, but could you run a command from kubectl directly, e.g. kubectl get ns
? I want to confirm if there's anything different about accessing the cluster programatically vs. from the shell directly. Thanks for providing these details.
The first time I got this
kubectl get ns error: You must be logged in to the server (Unauthorized)
then I did oc login -u kubeadmin -p D4tTL-hJYdy-qe36Y-okTwh https://api.crc.testing:6443 Login successful.
You have access to 62 projects, the list has been suppressed. You can list all projects with ' projects'
Using project "pol".
and this time it worked kubectl get ns NAME STATUS AGE default Active 15d gotest Active 2d21h gotest2 Active 2d20h kube-node-lease Active 15d kube-public Active 15d kube-system Active 15d openshift Active 15d openshift-apiserver Active 15d openshift-apiserver-operator Active 15d openshift-authentication Active 15d openshift-authentication-operator Active 15d openshift-cloud-credential-operator Active 15d openshift-cluster-csi-drivers Active 15d openshift-cluster-machine-approver Active 15d openshift-cluster-node-tuning-operator Active 15d openshift-cluster-samples-operator Active 15d openshift-cluster-storage-operator Active 15d openshift-cluster-version Active 15d openshift-config Active 15d openshift-config-managed Active 15d openshift-config-operator Active 15d openshift-console Active 15d openshift-console-operator Active 15d openshift-controller-manager Active 15d openshift-controller-manager-operator Active 15d openshift-dns Active 15d openshift-dns-operator Active 15d openshift-etcd Active 15d openshift-etcd-operator Active 15d openshift-image-registry Active 15d openshift-infra Active 15d openshift-ingress Active 15d openshift-ingress-operator Active 15d openshift-insights Active 15d openshift-kni-infra Active 15d openshift-kube-apiserver Active 15d openshift-kube-apiserver-operator Active 15d openshift-kube-controller-manager Active 15d openshift-kube-controller-manager-operator Active 15d openshift-kube-scheduler Active 15d openshift-kube-scheduler-operator Active 15d openshift-kube-storage-version-migrator Active 15d openshift-kube-storage-version-migrator-operator Active 15d openshift-machine-api Active 15d openshift-machine-config-operator Active 15d openshift-marketplace Active 15d openshift-monitoring Active 15d openshift-multus Active 15d openshift-network-operator Active 15d openshift-node Active 15d openshift-oauth-apiserver Active 15d openshift-openstack-infra Active 15d openshift-operator-lifecycle-manager Active 15d openshift-operators Active 15d openshift-ovirt-infra Active 15d openshift-sdn Active 15d openshift-service-ca Active 15d openshift-service-ca-operator Active 15d openshift-user-workload-monitoring Active 15d openshift-vsphere-infra Active 15d pol Active 42h squash-debugger Active 3d3h
So maybe some login must be provided in the plugin ? (just a guess, I have no idea)
Thank you for your help
You could reproduce my case by using a Codeready Container (CRC) Openshift local cluster, if you're interested (so you avoid losing time the crc program must be executed from drive C:). https://developers.redhat.com/products/codeready-containers/overview
@faysou thanks for giving that a try! Again, this might be a naive question, but what happens if you run Bridge now that you've run oc login
on the command line? I had a look at some openshift docs and it seems like once you run oc login
, it saves the configuration you selected.
I get exactly the same error.
There is some connection somehow from the plugin to the cluster as I'm able (and was able before as well) to run the configure step where I say which pod I want to replace, this step works and generates the following launch.json file, it's when it tries to do something with the cluster that it doesn't work.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package with Kubernetes",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}",
"preLaunchTask": "bridge-to-kubernetes.service",
"env": {
"GRPC_DNS_RESOLVER": "native"
}
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}"
}
]
}
@faysou I've logged a bug for us to investigate. It's interesting that the configuration step works fine, but not the prep-connect. It might be one of our dependencies that is causing an issue.
Thank you, I'm looking forward that your magical extension works in this setting. I haven't tested if it works in a real openshift cluster as I don't have access to one. But microsoft is big on Openshift with ARO.
Is the source of this extension open source ? I haven't found where is the code if it's available.
Hey @faysou, thanks again for your comments. We're working through how we can work with OpenShift right now and we'll hopefully have some updates by the end of the month. I did end up trying to create a CRC cluster locally, and I had to make this change to my kubeconfig:
- cluster: insecure-skip-tls-verify: true server: https://api.crc.testing:6443
Let me know if you try again & if it works for you!
Thank you @amsoedal
I've modified the config file in the .kube file and it goes indeed further in the process, the endpoint manager starts, but it doesn't work reliably.
I still get SSL errors after though, it worked further once but not after, so it's not a stable fix yet.
1) I've used this project as simple test code in Openshift, adding a component "+Add">"From Git" in the developer console: https://github.com/sclorg/golang-ex
2) Another thing I tried, when endpoint managed to work, I was using an odo "source to code" pipeline (https://odo.dev, this can push the code from the local directory when the instructions below are executed in the root directory of golang-ex, and build the code) odo create golang:latest --s2i --port 8080 odo url create odo push
And I got an error that ConfigChange was not supported because a custom command was executed (/opt/odo/bin/go-init)
So more food for thought for you and you have basic examples above to try to reproduce what I saw.
Thank you very much for your help.
Describe the bug I am trying to run the bridge on VSCode on my mac with a Go app that is deployed in a local cluster (k3d). I had to create a service to the pod because the pod does not require one, it is an autonomous slack bot. When launching the app I have the following error in the terminal
Digging into the logs I have the following logs in the
bridge-library-2020-10-29-17-54-35-58055.txt
file.To Reproduce install botkube with helm, create a service because it does not come with one
create a config in VSCode with 0 port to forward and no isolation. run the main.go "Launch with Kubernetes"
**Expected behavior** A clear and concise description of what you expected to happen. **Logs** Attach logs from the following directory: For Windows: %TEMP%/Bridge to Kubernetes For OSX/Linux: $TMPDIR/Bridge to Kubernetes this is the bridge-mindarocli.txt log ``` 2020-10-29T18:02:34.3174350Z | MindaroCli | TRACE | Event: Command.Start