我最近在 GKE 集群中启用了 IAP。
我按照这里的说明操作:https : //cloud.google.com/iap/docs/enabling-kubernetes-howto
服务配置如下:
---
apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: foo-bc-iap
namespace: foo-test
spec:
iap:
enabled: true
oauthclientCredentials:
secretName: iap-client-secret
---
apiVersion: v1
kind: Service
metadata:
name: foo-internal-service
namespace: foo-test
annotations:
cloud.google.com/backend-config: '{"ports":{"80":"foo-bc-iap"}}'
spec:
type: NodePort # To create Ingress using the service.
selector:
app: foo-test
ports:
- protocol: TCP
port: 80
targetPort: 8081
Run Code Online (Sandbox Code Playgroud)
我使用的凭据是 OAuth 2.0 客户端 ID(类型:Web 应用程序)。
当我在 Kubernetes 服务上激活 IAP 时,确保受 IAP 保护的 API 端点的工作方式不同后,我编写了以下测试程序以确保可以从 JSON 文件“account.json”中提供的服务帐户访问该端点。
在编写此示例应用程序时,我查阅了此文档:https …
jwt google-cloud-platform kubernetes google-kubernetes-engine google-iap
我正在编写一个程序,以下列模式形成一个新的子流程:
proc = java.lang.Runtime.getRuntime().exec("java -jar Xxx.jar");
Run Code Online (Sandbox Code Playgroud)
虽然环境变量会自动继承到子流程,但我认为定义的系统属性-D<name of property>=<value of the property>不是.
我的问题是,如果有任何方法以编程方式传输系统属性.欢迎任何评论或答案.谢谢.
作为Perl的新手,我只是不明白以下结果背后是什么样的哲学:
$cnt1 = @arr;
# this gives the length of the array 'arr'
$cnt2 = @arr[ @indices_arr ];
# this gives the last element of the @arr[ @indices_arr ];
Run Code Online (Sandbox Code Playgroud)
有人能解释两者之间的区别吗?