小编Pet*_*o M的帖子

kubectl错误:"您必须登录到服务器(服务器已要求客户端提供凭据)"

我正在运行以下命令并收到错误:

$ kubectl get nodes
error: You must be logged in to the server (the server has asked for the client to provide credentials)
Run Code Online (Sandbox Code Playgroud)

这是怎么回事?

kubernetes

6
推荐指数
1
解决办法
6540
查看次数

无法删除Kubernetes中节点的基础VM

我正在GCE上运行一个三节点群集。我想耗尽一个节点并删除基础虚拟机。

kubectl drain命令的文档说:

Once it returns (without giving an error), you can power down the node (or equivalently, if on a cloud platform, delete the virtual machine backing the node)

我执行以下命令:

  1. 获取节点

    $ kl get nodes
    NAME                                      STATUS    AGE
    gke-jcluster-default-pool-9cc4e660-6q21   Ready     43m
    gke-jcluster-default-pool-9cc4e660-rx9p   Ready     6m
    gke-jcluster-default-pool-9cc4e660-xr4z   Ready     23h
    
    Run Code Online (Sandbox Code Playgroud)
  2. 排水节点rx9p

    $ kl drain gke-jcluster-default-pool-9cc4e660-rx9p --force
    node "gke-jcluster-default-pool-9cc4e660-rx9p" cordoned
    WARNING: Deleting pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet: fluentd-cloud-logging-gke-jcluster-default-pool-9cc4e660-rx9p, kube-proxy-gke-jcluster-default-pool-9cc4e660-rx9p
    node "gke-jcluster-default-pool-9cc4e660-rx9p" drained
    
    Run Code Online (Sandbox Code Playgroud)
  3. 删除gcloud VM。

     $ …
    Run Code Online (Sandbox Code Playgroud)

google-compute-engine kubernetes google-kubernetes-engine

5
推荐指数
1
解决办法
739
查看次数

用C++打印浮点数的二进制表示

可能重复:
在C++中浮动到二进制

我想在C++中打印出浮点数的二进制表示.出于好奇,不太实用.

以下程序不能编译.reinterpret_cast失败.我可以使用什么样的演员表以便我可以做"&(1 << i)"部分?

#include <iostream>
using namespace std;


void toBinary(float num) {
  int numi = reinterpret_cast<int>(num);
  cout << num << " " << numi << endl;
  for (int i = 0; i < 8 * sizeof(num); i++){
    if (numi & (1<<i)) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
  cout << endl << endl;
}

int main() {
  float a;
  cout << sizeof(int) << " " << sizeof(float) << endl;
  a = 13.5; …
Run Code Online (Sandbox Code Playgroud)

c++ floating-point

3
推荐指数
1
解决办法
9577
查看次数

Pelican 博客生成器中的目录

我知道在 Pelican 中我可以使用该[TOC]行作为目录,但是我需要做什么才能启用它?

我必须MARKDOWNpelicanconf.py(设置文档在这里)中更改设置,但是更改看起来如何?

pelican

3
推荐指数
1
解决办法
685
查看次数