InvalidApplicationUID
このメッセージは、ワークロードがユーザーID(UID)1337
で実行されている場合に発生します。アプリケーションポッドはユーザーID(UID)1337
で実行すべきではありません。なぜなら、istio-proxyコンテナがUID 1337
で実行されるからです。同じUIDを使用してアプリケーションコンテナを実行すると、そのiptables
構成と競合が発生します。
例
Podレベルまたはコンテナレベルで、UID 1337
を使用して実行されるsecurityContext.runAsUser
を持つDeployment
を検討してください。
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy-con-sec-uid
labels:
app: helloworld
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: helloworld
version: v1
template:
metadata:
labels:
app: helloworld
version: v1
spec:
securityContext:
runAsUser: 1337
containers:
- name: helloworld
image: docker.io/istio/examples-helloworld-v1
securityContext:
runAsUser: 1337
resources:
requests:
cpu: "100m"
imagePullPolicy: IfNotPresent #Always
ports:
- containerPort: 5000
解決方法
ユーザーID(UID)1337
はサイドカープロキシ用に予約されているため、ワークロードには1338
のような別のユーザーID(UID)を使用できます。
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy-con-sec-uid
labels:
app: helloworld
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: helloworld
version: v1
template:
metadata:
labels:
app: helloworld
version: v1
spec:
securityContext:
runAsUser: 1338
containers:
- name: helloworld
image: docker.io/istio/examples-helloworld-v1
securityContext:
runAsUser: 1338
resources:
requests:
cpu: "100m"
imagePullPolicy: IfNotPresent #Always
ports:
- containerPort: 5000