jiebi/CodeConvo huggingface dataset:
Change:
In , I found a logic error (when I had a broken cloud implementation): If createLoadBalancerIfNeeded returns err, then cachedService will have service = nil. This causes updateLoadBalancerHosts to panic. It would be easy to skip cacheService if service=nil, but I wasn't sure whether this should then be included in servicesToRetry or not. Another problem (by inspection) is that I think there's a race condition where updateLoadBalancerHosts can run immediately after getOrCreate, before the service field has been set.
/cc
Great catches, Justin, thanks! I believe that simply not processing cached services with a nil api.Service object in the node pool reconciler is the correct approach. A nil Service object implies that the load balancer reconciler still intends to process it, and the LB reconciler always uses the most up-to-date list of nodes. I'll send a PR ASAP.

Discussion:
if err != nil { return err, retry } <del> // Always update the cache upon success </del> <ins> // Always update the cache upon success. // NOTE: Since we update the cached service if and only if we successully // processed it, a cached service being nil implies that it hasn't yet // been successfully processed. </ins> cachedService.service = service s.cache.set(namespacedName.String(), cachedService) case cache.Deleted:

func() { service.mu.Lock() defer service.mu.Unlock() <ins> // If the service is nil, that means it hasn't yet been successfully dealt // with by the load balancer reconciler. We can trust the load balancer // reconciler to ensure the service's load balancer is created to target // the correct nodes. if service.service == nil { return } </ins> if err := s.lockedUpdateLoadBalancerHosts(service.service, hosts); err != nil { glog.Errorf("External error while updating TCP load balancer: %v.", err) servicesToRetry = append(servicesToRetry, service)

{Name: "a999", Region: region, Hosts: []string{"node0", "node1", "node73"}}, }, }, <ins> { // One service has an external load balancer and one is nil: one call. services: []*api.Service{ newService("s0", "234", true), nil, }, expectedUpdateCalls: []fake_cloud.FakeUpdateBalancerCall{ {Name: "a234", Region: region, Hosts: []string{"node0", "node1", "node73"}}, }, }, </ins> } for _, item := range table { cloud := &fake_cloud.FakeCloud{}
Change:
This is missing and will break all CoreOS related stuff . /cc
looks so - i just did AntonioMeireles/kubernetes-vagrant-coreos-cluster to get around it ... waiting a bit to see if it was transient or not before propagating it urbi et orbi.
Well, I think it's better if we just use the upstream and not said missing URL.
This is not resolved by updating to the upstream URL for the setup-network-environment binary. I've turned over the k8s bucket on GCE so I don't plan to use it going forward.
I'm not sure I follow you So you mean this binary is no longer needed? I don't understand why the issue was closed.
Nevermind

Discussion:
[Service] ExecStartPre=-/usr/bin/mkdir -p /opt/bin <del> ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment </del> <ins> ExecStartPre=/usr/bin/wget -N -P /opt/bin https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment </ins> ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment ExecStart=/opt/bin/setup-network-environment RemainAfterExit=yes
Change:
PATCH http://IP:8080/api/v1beta3/namespaces/dev--ea6f-49cb-b5bb-/replicationcontrollers/redis-master {"spec":{"replicas":0}} answer: { "kind": "Status", "apiVersion": "v1beta3", "metadata": {}, "status": "Failure", "message": "the server responded with the status code 415 but did not return more information", "details": {}, "code": 415 } Before v0.15.0 it had worked well.
That error is returned by go-restful because it did not find any valid route with the same content type as specified in the request: Can you try setting the content-type in your request as is described here: cc
well, I've the same issue which is not fixed by setting the value, at least with the "strategic merge patch". Here's the request: Here's the response body: And here's the log trace of the request in the apiserver pod:
Come from a typo, purposed PR here:
Btw, I'm still having strange issues with sub-objects. Note that it appears only is the sub-object is already set. Here's the request: Here's the API log:
Looks like a bug in strategic merge -- it doesn't deal with pointers correctly:
cc
is it possible to have a milestone for this so I can tell if I should merger ? Thanks.

Discussion:
original[k] = patchV continue } <ins> // If the data type is a pointer, resolve the element. if t.Kind() == reflect.Ptr { t = t.Elem() } </ins> // If they're both maps or lists, recurse into the value. // First find the fieldPatchStrategy and fieldPatchMergeKey. fieldType, fieldPatchStrategy, fieldPatchMergeKey, err := forkedjson.LookupPatchMetadata(t, k)

NonMergingList    []MergeItem MergingIntList    []int `patchStrategy:"merge"` NonMergingIntList []int <ins> MergeItemPtr      *MergeItem `patchStrategy:"merge" patchMergeKey:"name"` </ins> SimpleMap         map[string]string }

- $patch: replace result: mergingList: [] <ins> - description: add new field inside pointers original: mergeItemPtr: - name: 1 patch: mergeItemPtr: - name: 2 result: mergeItemPtr: - name: 1 - name: 2 - description: update nested pointers original: mergeItemPtr: - name: 1 mergeItemPtr: - name: 1 - name: 2 value: 2 - name: 2 patch: mergeItemPtr: - name: 1 mergeItemPtr: - name: 1 value: 1 result: mergeItemPtr: - name: 1 mergeItemPtr: - name: 1 value: 1 - name: 2 value: 2 - name: 2 </ins> sortMergeListTestCases: - description: sort one list of maps original:

- 1 - 2 - 3 <ins> - description: sort nested pointers of ints original: mergeItemPtr: - name: 2 mergingIntList: - 1 - 3 - 2 - name: 1 mergingIntList: - 2 - 1 sorted: mergeItemPtr: - name: 1 mergingIntList: - 1 - 2 - name: 2 mergingIntList: - 1 - 2 - 3 - description: sort one pointer of maps original: mergeItemPtr: - name: 1 - name: 3 - name: 2 sorted: mergeItemPtr: - name: 1 - name: 2 - name: 3 </ins> `) func TestStrategicMergePatch(t *testing.T) {
Change:
During an e2e test run, on GCE, I ssh-ed into the box. After the reboot test runs, it appears that something is trying to start kubelet every 2 minutes after the reboot: It does appear that it is monit restarting the process: I do only have one copy of kubelet running, because the second kubelet fails to start:
The direct cause of monit thinking the kubelet is down is that does not match. Also, keeps changing (every two minutes?) My hypothesis is that the second kubelet writes the pid, because it gets pretty far in its boot-up. And thereafter, monit sees it as down so keeps trying to start more. And so the root cause is that first second kubelet start, which I think is down to this: My kubelet is currently listening to that url though: My guess is that kubelet is too slow to start listening to /healthz
Oh! ... or it's a simple race with init.d starting the services; monit vs kube-proxy. If monit starts kube-proxy before init.d starts kube-proxy =double start.
/cc
Ok, there is a race when monit is used to monitor services that are also started at boot time via init.d, in our ecosystem, such as kubelet, kube-proxy, and docker. Especially when a service is slow to start, monit can assume that the service is not running and possibly try to start it and raise an issue while the service is already about to start or already in its startup sequence. In this case, there is a stale pidfile which is used by monit during the service validation periodically (currently configured every 2 mins), thus run into the issue reported by here. A clean way to fix this is starting those kubernetes related services requiring monitoring by monit directly by monit. The issue is that monit is not installed by default in our gce images for now. My proposed solution is that for each dostart call in /etc/init.d/${servicedaemon}, checking if there is existing process running. If it does, kill it before calling start-stop-daemon --start Will send pr shortly.

Discussion:
# do_start() { <ins> # Avoid a potential race at boot time when both monit and init.d start # the same service PIDS=$(pidof $DAEMON) for PID in ${PIDS}; do kill -9 $PID done </ins> # Raise the file descriptor limit - we expect to open a lot of sockets! ulimit -n 65536

# do_start() { <ins> # Avoid a potential race at boot time when both monit and init.d start # the same service PIDS=$(pidof $DAEMON) for PID in ${PIDS}; do kill -9 $PID done </ins> # Return #   0 if daemon has been started #   1 if daemon was already running
Change:
I saw the below failure in [Performance suite] should allow starting 30 pods per node. Some requests with verb:PROXY took more than 10 seconds, and are causing the test to fail. I think that proxy issues are a different test, right? (maybe testMonitoringUsingHeapsterInfluxdb?) And that this taking 10 seconds could be very reasonable, depending on what we're proxying. There is this note in If that is the case, sounds like we should either clear the metrics, or if that is hard, record them before we run our test and ignore the pre-existing ones.
Yeah we should clearly exclude proxy from those metrics. This test is still being actively worked on :)
+1 for excluding proxy metrics This should be very simple fix, because we're already exluding all "watches" from the metrics. Reassigning it to me - will fix it today.
is sent out for review.
thanks for fixing!

Discussion:
// Prints summary metrics for request types with latency above threshold // and returns number of such request types. func HighLatencyRequests(c *client.Client, threshold time.Duration, ignoredResources util.StringSet) (int, error) { <ins> ignoredVerbs := util.NewStringSet("WATCHLIST", "PROXY") </ins> metrics, err := ReadLatencyMetrics(c) if err != nil { return 0, err

var badMetrics []LatencyMetric for _, metric := range metrics { if !ignoredResources.Has(metric.resource) && <del> metric.verb != "WATCHLIST" && </del> <ins> !ignoredVerbs.Has(metric.verb) && </ins> // We are only interested in 99%tile, but for logging purposes // it's useful to have all the offending percentiles. metric.quantile <= 0.99 &&
Change:
WARNING: Lists should be separated by commas, try "--metadata-from-file=kube-env=/tmp/kubernetes.sCQI6j/master-kube-,startup-". If you intend to use startup- for positional arguments, put them before the flag.

Discussion:
--network "${NETWORK}"  $2  --can-ip-forward  <del> --metadata-from-file "$3" "$4"; then </del> <ins> --metadata-from-file "$3","$4"; then </ins> if (( attempt > 5 )); then echo -e "${color_red}Failed to create instance template $1 ${color_norm}" >&2 exit 2

if ! gcloud compute instances add-metadata "${instance}"  --project "${PROJECT}"  --zone "${ZONE}"  <del> --metadata-from-file "${kvs[@]}"; then </del> <ins> --metadata-from-file $(IFS=, ; echo "${kvs[*]}"); then </ins> if (( attempt > 5 )); then echo -e "${color_red}Failed to add instance metadata in ${instance} ${color_norm}" exit 2
Change:
The "service" file in this document contains a trailing comma on the line ' "name": "my-service", ` and thus kubectl fails to parse it properly.

Discussion:
``` Note that we are still working on making all containerized the master components run smoothly in rkt. Before that we are not able to run the master node with rkt yet. <ins> [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/rkt/README.md?pixel)]() </ins>

"kind": "Service", "apiVersion": "v1beta3", "metadata": { <del> "name": "my-service", </del> <ins> "name": "my-service" </ins> }, "spec": { "selector": {
Change:
Without , works just fine, With '--api-prefix=xxx-api', it stops work: My version: could you take a look? Thanks.
--api-prefix was in . could you take a look? This appears to be completely broken, so we should fix it or rip it out.
Reading the code and I find the way to fix it. You need to use , note the slashes. I will fix the man page.
What's an example command line that works?
then
Ah, the default flag value has leading and trailing slashes: The example in the documentation is wrong: Re-opening for doc fix.
The trailing slash is not necessary. and duplicate each other.

Discussion:
$ kubectl proxy --port=8011 --www=./local/www/ // Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api <del> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta1/pods/ $ kubectl proxy --api-prefix=k8s-api </del> <ins> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta3/pods/ $ kubectl proxy --api-prefix=/k8s-api </ins> ``` ### Options

### SEE ALSO * [kubectl](kubectl.md)	 - kubectl controls the Kubernetes cluster manager <del> ###### Auto generated by spf13/cobra at 2015-05-21 10:33:11.188518514 +0000 UTC </del> <ins> ###### Auto generated by spf13/cobra at 2015-05-28 20:57:46.689818993 +0000 UTC </ins> [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/kubectl_proxy.md?pixel)]()

$ kubectl proxy --port=8011 --www=./local/www/ // Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api <del> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta1/pods/ $ kubectl proxy --api-prefix=k8s-api </del> <ins> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta3/pods/ $ kubectl proxy --api-prefix=/k8s-api </ins> .fi .RE

$ kubectl proxy --port=8011 --www=./local/www/ // Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api <del> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta1/pods/ $ kubectl proxy --api-prefix=k8s-api` </del> <ins> // This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta3/pods/ $ kubectl proxy --api-prefix=/k8s-api` </ins> ) func NewCmdProxy(f *cmdutil.Factory, out io.Writer) *cobra.Command {
Change:
I execute:
Appears to be related to changes made in this PR:
Looks like the change here: should have a different set of param names than
Looks like they do have a different set of names, but for the wrong default was set.

Discussion:
func (BasicReplicationController) ParamNames() []GeneratorParam { return []GeneratorParam{ {"labels", false}, <del> {"default-name", true}, {"name", false}, </del> <ins> {"default-name", false}, {"name", true}, </ins> {"replicas", true}, {"image", true}, {"port", false},
Change:
I follow the instruction to start the kubernetes web UI. It's 404 when I open http://127.0.0.1:8080 . Finally I knew that the correct directory is http://127.0.0.1:8080/static/app/#/dashboard/ . We should start the web ui in root directory(I mean http://127.0.0.1:8080) so that anyone like me will not be confused.
/sub
I agree the UI isn't very discoverable. We should redirect from to the correct path. (Assuming that the UI is working well enough to expose it at all.)
I can do this if no one else is on it. Should we redirect and for all requests or just requests with specific user-agents or MIME types?
We return a list of resource paths on currently: We could either redirect for certain user-agents, or choose another, simpler, more obvious, top-level path, like or , which would at least show up in the list of valid paths.
That's great!
Great job :+1:

Discussion:
assetfs "github.com/elazarl/go-bindata-assetfs" ) <ins> const dashboardPath = "/static/app/#/dashboard/" </ins> type MuxInterface interface { Handle(pattern string, handler http.Handler) <ins> HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) </ins> } func InstallSupport(mux MuxInterface, enableSwaggerSupport bool) {

fileServer := http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "www"}) prefix := "/static/" mux.Handle(prefix, http.StripPrefix(prefix, fileServer)) <ins> prefix = "/ui/" mux.HandleFunc(prefix, func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, dashboardPath, http.StatusTemporaryRedirect) }) </ins> if enableSwaggerSupport { // Expose files in third_party/swagger-ui/ on <host>/swagger-ui
Change:
Example: kubectl cluster-info shows a redundant line: The cluster is already up, so the phrase "Starting cluster" is confusing in context of the command. (My kubernetes test cluster is running on AWS i.e. KUBERNETES_PROVIDER=aws. I had used kube- to create a test kubernetes cluster on aws). Log of my shell session:
Thanks for the bug report I've filed a PR to fix it.

Discussion:
case "${KUBE_OS_DISTRIBUTION}" in ubuntu|coreos) <del> echo "Starting cluster using os distro: ${KUBE_OS_DISTRIBUTION}" >&2 </del> source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh" ;; *)

function kube-up { <ins> echo "Starting cluster using os distro: ${KUBE_OS_DISTRIBUTION}" >&2 </ins> get-tokens detect-image
Change:
nginx example missing step to create firewall rule (tcp:80 targettag:kubernetes-minion) from these instructions:

Discussion:
kubectl expose rc my-nginx --port=80 --type=LoadBalancer ``` <del> This should print the service that has been created, and map an external IP address to the service. </del> <ins> This should print the service that has been created, and map an external IP address to the service. Where to find this external IP address will depend on the environment you run in.  For instance, for Google Compute Engine the external IP address is listed as part of the newly created service and can be retrieved by running ```bash kubectl get services ``` In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80. </ins> ### Next: Configuration files Most people will eventually want to use declarative configuration files for creating/modifying their applications.  A [simplified introduction](simple-yaml.md)
Change:
We have rotation of logs from docker containers, but not for logs from docker Without rotation, the logs may fill the root partition entirely.
I can add rotation (5 files, 100MB each) if you decide it goes for v1.0 (for me it's a blocker). I'm not sure which platforms are affected. For sure GCE. cc
Sure, send a PR and I'm sure we can merge it.

Discussion:
<del> /var/lib/docker/containers/*/*-json.log { rotate 5 copytruncate missingok notifempty compress maxsize 10M daily create 0644 root root } </del>

<ins> /var/lib/docker/containers/*/*-json.log { rotate 5 copytruncate missingok notifempty compress maxsize 10M daily create 0644 root root } </ins>

pkg: - installed <del> {% set logrotate_files = ['kube-scheduler', 'kube-proxy', 'kubelet', 'kube-apiserver', 'kube-controller-manager', 'kube-addons'] %} </del> <ins> {% set logrotate_files = ['kube-scheduler', 'kube-proxy', 'kubelet', 'kube-apiserver', 'kube-controller-manager', 'kube-addons', 'docker'] %} </ins> {% for file in logrotate_files %} /etc/logrotate.d/{{ file }}: file:

file: {{ file }} {% endfor %} <del> /etc/logrotate.d/docker: </del> <ins> /etc/logrotate.d/docker-containers: </ins> file: - managed <del> - source: salt://logrotate/docker </del> <ins> - source: salt://logrotate/docker-containers </ins> - template: jinja - user: root - group: root
Change:
has a hardcoded bin path. This is not the path for yum installed Kubernetes and maybe more cases. Should be a variable at least. similar to .
I think has the most kubectl context and can figure out something reasonable to do here?

Discussion:
# The business logic for whether a given object should be created # was already enforced by salt, and /etc/kubernetes/addons is the # managed result is of that. Start everything below that directory. <del> KUBECTL=/usr/local/bin/kubectl </del> <ins> KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl} </ins> function create-kubeconfig-secret() { local -r token=$1
Change:
I find questionable, as the check always fails when directory doesn't exist, and it's being created .
nice reading. The basic idea is to ensure the directory is not already mounted before rbd starts to use this directory to mount the device. you'll find kubelet checks the volume mount periodically. If kubelet finds the volume is already mounted, it won't mount it again. This is why kubelet probes the existence of mount point.
But then who's going to bootstrap the directory if is never reached? I managed to get out of this loop only by issuing myself, after which the pod started up.
if is not reached, something wrong happened. Do you have a kubelet log I can peek?
btw, are you still using containerized kubelet?
Kubelet isn't containerized (is that even possible to use one with rbd mounts?)
looks i made a regression
opened to fix it, thank you for spotting this problem!

Discussion:
// mount it globalPDPath := rbd.manager.MakeGlobalPDName(rbd) mountpoint, err := rbd.mounter.IsMountPoint(globalPDPath) <del> if err != nil { </del> <ins> // in the first time, the path shouldn't exist and IsMountPoint is expected to get NotExist if err != nil && !os.IsNotExist(err) { </ins> return fmt.Errorf("rbd: %s failed to check mountpoint", globalPDPath) } if mountpoint {
Change:
The namespace seems to be hard coded :
cc:
Thanks. We can improve it after v1 release.

Discussion:
resources: limits: cpu: "0.5" <del> image: gcr.io/google_containers/cassandra:v4 </del> <ins> image: gcr.io/google_containers/cassandra:v5 </ins> name: cassandra ports: - name: cql

- /run.sh resources: limits: <del> cpu: 0.5 </del> <ins> cpu: 0.1 </ins> env: - name: MAX_HEAP_SIZE value: 512M

valueFrom: fieldRef: fieldPath: metadata.namespace <del> image: gcr.io/google_containers/cassandra:v4 </del> <ins> image: gcr.io/google_containers/cassandra:v5 </ins> name: cassandra ports: - containerPort: 9042

- /run.sh resources: limits: <del> cpu: "0.5" image: gcr.io/google_containers/cassandra:v4 </del> <ins> cpu: "0.1" image: gcr.io/google_containers/cassandra:v5 </ins> name: cassandra ports: - name: cql