better istio?
This commit is contained in:
parent
98e08f5301
commit
63505ae86f
@ -1,36 +1,59 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: istio-ingress
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: istio-ingressgateway
|
|
||||||
namespace: istio-ingress
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: istio-ingressgateway
|
name: istio-ingressgateway
|
||||||
namespace: istio-ingress
|
namespace: istio-ingress
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
istio: ingressgateway
|
istio: ingressgateway
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
|
||||||
istio: ingressgateway
|
|
||||||
annotations:
|
annotations:
|
||||||
|
# Select the gateway injection template (rather than the default sidecar template)
|
||||||
inject.istio.io/templates: gateway
|
inject.istio.io/templates: gateway
|
||||||
|
labels:
|
||||||
|
# Set a unique label for the gateway. This is required to ensure Gateways can select this workload
|
||||||
|
istio: ingressgateway
|
||||||
|
# Enable gateway injection. If connecting to a revisioned control plane, replace with "istio.io/rev: revision-name"
|
||||||
sidecar.istio.io/inject: "true"
|
sidecar.istio.io/inject: "true"
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: istio-ingressgateway
|
# Allow binding to all ports (such as 80 and 443)
|
||||||
|
securityContext:
|
||||||
|
sysctls:
|
||||||
|
- name: net.ipv4.ip_unprivileged_port_start
|
||||||
|
value: "0"
|
||||||
containers:
|
containers:
|
||||||
- name: istio-proxy
|
- name: istio-proxy
|
||||||
image: auto
|
image: auto # The image will automatically update each time the pod starts.
|
||||||
ports:
|
# Drop all privileges, allowing to run as non-root
|
||||||
- containerPort: 8080
|
securityContext:
|
||||||
- containerPort: 15021
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
runAsUser: 1337
|
||||||
|
runAsGroup: 1337
|
||||||
|
---
|
||||||
|
# Set up roles to allow reading credentials for TLS
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: istio-ingressgateway-sds
|
||||||
|
namespace: istio-ingress
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["secrets"]
|
||||||
|
verbs: ["get", "watch", "list"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: istio-ingressgateway-sds
|
||||||
|
namespace: istio-ingress
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: istio-ingressgateway-sds
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: default
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user