我有一个裸机Kubernetes定制设置(手动使用Kubernetes艰难地设置集群)。一切似乎正常,但我无法从外部访问服务。
我可以在curl时获得服务列表:
https://<ip-addr>/api/v1/namespaces/kube-system/services
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试代理时(使用kubectl proxy,也使用<master-ip-address>:<port>):
https://<ip-addr>/api/v1/namespaces/kube-system/services/toned-gecko-grafana:80/proxy/
Run Code Online (Sandbox Code Playgroud)
我得到:
Error: 'dial tcp 10.44.0.16:3000: connect: no route to host'
Trying to reach: 'http://10.44.0.16:3000/'
Run Code Online (Sandbox Code Playgroud)
即使我正常卷曲,能够解决此问题,请检查以下内容。http://10.44.0.16:3000/我也会遇到相同的错误。这是我是否从安装Kubernetes的VM内部卷曲的结果。
我可以使用NodePort从外部访问我的服务。
如果通过Nginx-Ingress公开我的服务,则可以访问它们。
我将Weave用作CNI,并且日志很正常,除了开始时有几条关于它无法访问命名空间的日志行(RBAC错误)。尽管那之后日志还不错。
使用CoreDNS,日志看起来很正常。APIServer和Kubelet日志看起来很正常。Kubernetes-Events看起来也很正常。
附加说明:我分配的DNS服务IP是10.3.0.10,服务IP范围是:10.3.0.0/24,而POD网络是10.2.0.0/16。我不确定10.44.x.x它是什么或它来自哪里。
这是其中一项服务的输出:
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "kubernetes-dashboard",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
"uid": "5c8bb34f-c6a2-11e8-84a7-00163cb4ceeb",
"resourceVersion": "7054",
"creationTimestamp": "2018-10-03T00:22:07Z",
"labels": {
"addonmanager.kubernetes.io/mode": "Reconcile",
"k8s-app": "kubernetes-dashboard",
"kubernetes.io/cluster-service": "true"
},
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"kubernetes-dashboard\",\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"port\":443,\"targetPort\":8443}],\"selector\":{\"k8s-app\":\"kubernetes-dashboard\"}}}\n" …Run Code Online (Sandbox Code Playgroud) 问题是,我有一个 android rom,它有一个我正在尝试移植的应用程序。但是应用程序需要的一些类在框架内。我已经有了 smali(通过 smali-backsmali 工具反编译 framework.jar 中的 classes.dex)和 java(通过源代码)格式的类。但我的问题是,如何在 apk 中实现/添加它们?我知道 classes.dex 中存在类。
我试过以下->
1)使用apktool反编译apk,并在反编译apk后出现的smali文件夹中添加带有相应路径的类文件(smali格式)。步骤中的问题->当我重新编译apk时,不知何故我在编译apk时不会出现我自己添加的类。说的更清楚->假设默认情况下,反编译apk的smali文件夹中包含X类。我添加了 Y 类(通过简单地将 Y.smali 文件复制到反编译的 smali 文件夹中)。但是当我重新编译apk时,重新编译的apk的classes.dex只包含X类,Y类仍然缺失。
2) 从 apk 存档中提取 classes.dex 并使用 backsmali 获取 classout 文件夹。然后将其他需要的类复制到其中,然后再次将其重新打包到 classes.dex 中。然后我将新的 classes.dex 放回 apk 存档(我将“new-classes.dex”重命名为“classes.dex”并将 apk 存档中的那个替换为我刚刚创建的较新的存档)。此步骤中的问题-> 它在 logcat 中给出了错误为-
E/dalvikvm(2373): Dex cache directory isn't writable: /data/dalvik-cache
I/dalvikvm(2373): Unable to open or create cache for /system/app/Test.apk (/data/dalvik-cache/system@app@Test.apk@classes.dex)
D/AndroidRuntime(2373): Shutting down VM
W/dalvikvm(2373): threadid=1: thread exiting with uncaught exception (group=0x41607ce0)
Run Code Online (Sandbox Code Playgroud)
最后它无法实例化应用程序。
请注意:在使用 apk 多工具重新编译或通过 winrar 手动将 classes.dex 放入存档时,我对 …
我刚刚开始学习C,今天我得到了一个问题,其中一个部分是接受用户的数字数组并按升序排列.数组大小也由用户指定.我为此目的使用了以下代码 - >
for (i = 0; i <= y - 1; ++i) {
for (ii = i + 1; ii <= y - 1; ++ii) {
if (x[i] > x[ii]) {
temp = x[i];
x[i] = x[ii];
x[ii] = temp;
}
}
}
int k;
printf("\nNumbers arranged in ascending order:\n");
for (k = 0; k < y; ++k) {
printf("%d\n", x[i]);
}
Run Code Online (Sandbox Code Playgroud)
这里,变量y是数组的大小,x是数组变量的名称(所以变量定义就像这样 - > int x[y];
但问题是,它只打印出数组的最终值.详细说明问题:假设我输入3为我的数组大小.然后程序问我3个数字,我选择34,45,22.现在执行完整个代码后,它显示x [3](现在x [3]甚至不存在!因为x [2] ]是数组中的最终值.所以它给了我变量的内存位置.)我哪里出错了?
场景是这样的:
我已经同步了android源代码(aosp).我想在我的存储库中创建它的"分叉".但由于我无法找到一种方法来分叉一个特定的分支而不是整个仓库,我决定手动推送它.为此,我在github上创建了一个新的裸存储库.
我的项目有两个遥控器:
* aosp = https://android.googlesource.com/path_to_project.git
#The default remote using which I synced repo
* upstream = https://github.com/<my github user-name>/<newly created repo name>.git
#The remote I added manually
Run Code Online (Sandbox Code Playgroud)
我尝试通过以下方法推送它:
#First added remote to that bare repository
git remote add upstream https://github.com/<my github user-name>/<newly created repo name>.git
#This is the branch for which I want to fork that project
git checkout -b kitkat-mr2.2-release
#I want the branch to be named kitkat in my own repo
git push -u upstream kitkat-mr2.2-release:kitkat …Run Code Online (Sandbox Code Playgroud) 我正在努力将光环添加到cyanogenmod 11中.为此,我使用的方法可以使光晕处于活动状态,然后相应地为其分配图像.
首先,这是我最近尝试的代码(我已多次尝试完成此任务) - >
protected void updateHalo() {
//mHaloActive is a boolean. mHaloButton is an ImageView
mHaloActive = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.HALO_ACTIVE, 0) == 1;
int resID;
String mDrawableName;
if (mHaloActive) {
mDrawableName = "ic_notify_halo_pressed";
resID = getResources().getIdentifier(mDrawableName, "drawable", getPackageName());
mHaloButton.setImageResource(resID);
} else {
mDrawableName = "ic_notify_halo_normal";
resID = getResources().getIdentifier(mDrawableName, "drawable", getPackageName());
mHaloButton.setImageResource(resID);
}
if (mHaloActive) {
if (mHalo == null) {
LayoutInflater inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mHalo = (Halo) inflater.inflate(R.layout.halo_trigger, null);
mHalo.setLayerType(View.LAYER_TYPE_HARDWARE, null);
WindowManager.LayoutParams params = mHalo.getWMParams();
mWindowManager.addView(mHalo, params); …Run Code Online (Sandbox Code Playgroud) 我正在从头开始配置 Kubernetes 集群(原因)。它是虚拟机内部的本地设置,一切都很好,除了master节点被创建为可调度的。
我尝试master通过将必需的参数传递给 kubelet 二进制文件来为节点分配标签和适当的污点(不能解决问题):
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule
--node-labels=master,node-role.kubernetes.io/master=""
Run Code Online (Sandbox Code Playgroud)
这是来自的输出kubectl describe <node>:
Name: myNodeName
Roles: master
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/hostname=myHostName
master=
node-role.kubernetes.io/master=
Annotations: node.alpha.kubernetes.io/ttl=0
volumes.kubernetes.io/controller-managed-attach-detach=true
CreationTimestamp: Tue, 03 Jul 2018 05:56:53 +0000
Taints: node-role.kubernetes.io/master=true:NoSchedule
Unschedulable: false
Run Code Online (Sandbox Code Playgroud)
如何将此节点设置为不可调度?文档并没有真正指定这一点(请随意指向文档的适当部分,以防我遗漏了某些内容)。
PS:上面提到的标签/污点在创建/注册节点之前就存在。
这是我的代码:
import java.text.DecimalFormat;
public class asd {
public static void main(String args[]) {
DecimalFormat d = new DecimalFormat("#00.00");
System.out.println(d.format(0250));
}
}
Run Code Online (Sandbox Code Playgroud)
它给出168.00了答案.这不是我期待的答案(250.00).为什么会这样?
android ×2
java ×2
kubernetes ×2
arrays ×1
c ×1
class ×1
cyanogenmod ×1
git ×1
github ×1
networking ×1