具有基本身份验证的Minikube无法启动

时间:2018-12-09 21:51:00

标签: kubernetes minikube

我正在尝试使用最新的minikube测试基本身份验证,但无法启动。

首先,我使用以下内容启动minikube

public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.MyViewHolder> {

    private static final String TAG = SearchAdapter.class.getSimpleName();

    private Context mContext;
    private final DB_Controller dbController;
    private ArrayList<Cards> cards;

    public class MyViewHolder extends RecyclerView.ViewHolder {
        public TextView card_name, type, rarity, artist;
        public Button addCollectionButton;


        public MyViewHolder(View itemView) {
            super(itemView);

            card_name = (TextView)itemView.findViewById(R.id.card_name);
            type = (TextView)itemView.findViewById(R.id.type);
            rarity = (TextView)itemView.findViewById(R.id.rarity);
            artist = (TextView)itemView.findViewById(R.id.artist);
            addCollectionButton = (Button)itemView.findViewById(R.id.button_collection);
        }
    }


    public SearchAdapter(Context context, ArrayList<Cards> cards) {
        this.mContext = context;
        dbController = new DB_Controller(context,"collection.db",null,1);
        this.cards = cards;
    }


    @Override
    public MyViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType) {
        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        View itemView = inflater.inflate(R.layout.layout_item, parent, false);
        return new MyViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        Cards cardsData = cards.get(position);

        holder.card_name.setText(cardsData.getName());
        holder.type.setText(cardsData.getType());
        holder.rarity.setText(cardsData.getRarity());
        holder.artist.setText(cardsData.getArtist());

        holder.addCollectionButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.e(TAG, "on click " + position);

                String cardName = cardsData.getName();
                String cardType = cardsData.getType();
                String cardRarity = cardsData.getRarity();
                String cardArtist = cardsData.getArtist();

                // You will need to add the data as needed!
                dbController.insert_card("drl","drl", "drl", "drl", "drl");
                Toast.makeText(mContext, "ADDED TO COLLECTION: " + cardName, Toast.LENGTH_LONG).show(); //confirm card was added
            }
        });
    }

    @Override
    public int getItemCount() {
        return cards.size();
    }
}

运行后,我将使用minikube --cpus 6 --memory 10000 --alsologtostderr start --kubernetes-version="v1.13.0" --vm-driver=virtualbox 并创建包含内容minikube ssh的文件/var/lib/minikube/certs/mini/users.csv

即。

somepassword,johndoe,johndoe123,developers

然后我$ ls -lat /var/lib/minikube/certs/mini/users.csv -rw-r--r-- 1 root root 43 Dec 9 21:31 /var/lib/minikube/certs/mini/users.csv $ more /var/lib/minikube/certs/mini/users.csv somepassword,johndoe,johndoe123,developers 并按如下所示重新启动

minikube stop

这导致了以下错误

minikube --cpus 6 --memory 10000 --alsologtostderr start --kubernetes-version="v1.13.0" --vm-driver=virtualbox \
--extra-config=apiserver.basic-auth-file=/var/lib/minikube/certs/mini/users.csv

我仍然可以进入minikube,I1209 21:33:34.716833 7099 ssh_runner.go:57] Run: sudo mkdir -p /var/lib/minikube/certs/ I1209 21:33:34.775015 7099 ssh_runner.go:57] Run: sudo rm -f /var/lib/minikube/certs/proxy-client.key I1209 21:33:34.820764 7099 ssh_runner.go:57] Run: sudo mkdir -p /var/lib/minikube/certs/ I1209 21:33:34.878749 7099 ssh_runner.go:57] Run: sudo rm -f /var/lib/minikube/kubeconfig I1209 21:33:34.928998 7099 ssh_runner.go:57] Run: sudo mkdir -p /var/lib/minikube Connecting to cluster... Setting up kubeconfig... I1209 21:33:35.231167 7099 config.go:125] Using kubeconfig: /home/paulhopkins/.kube/config Starting cluster components... I1209 21:33:35.235662 7099 ssh_runner.go:57] Run: sudo kubeadm alpha phase certs all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase kubeconfig all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase controlplane all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase etcd local --config /var/lib/kubeadm.yaml E1209 21:33:35.268920 7099 start.go:302] Error restarting cluster: running cmd: sudo kubeadm alpha phase certs all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase kubeconfig all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase controlplane all --config /var/lib/kubeadm.yaml && sudo /usr/bin/kubeadm alpha phase etcd local --config /var/lib/kubeadm.yaml : Process exited with status 1 如下:

kubeadm.yaml

Minikube版本为v0.30.0。我在做什么错了?

0 个答案:

没有答案