Я работаю над весенним облачным приложением потока данных. Я могу запустить облачный сервер потоков данных Spring со шкипером, работающим в Cloud Foundry. Теперь я пытаюсь выполнить то же самое с шкипером, работающим в кластере kubernetes и получающим ниже ошибку при развертывании, хотя я явно указываю имя пользователя в конфигурации среды при развертывании.
Причина: io. fabric8.kubernetes.client.KubernetesClientException: ошибка выполнения: GET at: kubernetes_cluster_url: 6443 / api / v1 / namespaces / pocdev / services? labelSelector = spring-app-id% 3Dtest444-pocclient. Сервисный аккаунт может быть аннулирован. Услуги запрещены: Пользователь "system: anonymous" не может перечислить ресурс "services" в группе API "" в пространстве имен "poc-dev".
SKIPPER YML для KUBERNETES DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
metadata:
name: skipper-server
labels:
app: skipper-server
spec:
replicas: 1
selector:
matchLabels:
app: skipper-server
template:
metadata:
labels:
app: skipper-server
annotations:
kubernetes.io/psp: nonroot
spec:
containers:
- name: skipper-server
image: <image_location>
imagePullPolicy: Always
ports:
- containerPort: 7577
protocol: TCP
resources:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: 25m
memory: 1Gi
securityContext:
runAsUser: 99
env:
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_FABRIC8_MASTER_URL"
value: "<kubernetes_master_url>:6443"
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_FABRIC8_USERNAME"
value: "<user>"
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_FABRIC8_PASSWORD"
value: "<pwd>"
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_FABRIC8_NAMESPACE"
value: "<namespace>"
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_FABRIC8_TRUST_CERTS"
value: "true"
- name: "SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_KUBERNETES_ACCOUNTS_K8S_CREATE_LOAD_BALANCER"
value: "true"
ПОЛНАЯ СТЕПЕНЬ
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: <kubernetes_cluster_url:6443/api/v1/namespaces/pocdev/services?labelSelector=spring-app-id%3Dtest444-pocclient . Service account may have been revoked. services is forbidden: User "system:anonymous" cannot list resource "services" in API group "" in the namespace "poc-dev". at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:476) ~[kubernetes-client-4.1.0.jar!/:na] at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:413) ~[kubernetes-client-4.1.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:381) ~[kubernetes-client-4.1.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:344) ~[kubernetes-client-4.1.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:328) ~[kubernetes-client-4.1.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.list(BaseOperation.java:598) ~[kubernetes-client-4.1.0.jar!/:na]
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.list(BaseOperation.java:63) ~[kubernetes-client-4.1.0.jar!/:na]
at org.springframework.cloud.deployer.spi.kubernetes.KubernetesAppDeployer.status(KubernetesAppDeployer.java:196) ~[spring-cloud-deployer-kubernetes-2.0.2.RELEASE.jar!/:2.0.2.RELEASE]
at org.springframework.cloud.deployer.spi.kubernetes.KubernetesAppDeployer.deploy(KubernetesAppDeployer.java:103) ~[spring-cloud-deployer-kubernetes-2.0.2.RELEASE.jar!/:2.0.2.RELEASE]
at org.springframework.cloud.skipper.server.deployer.DefaultReleaseManager.install(DefaultReleaseManager.java:115) ~[spring-cloud-skipper-server-core-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
... 50 common frames omitted