expert > Très bien, voici votre yaml:
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-namespace
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: nginx-namespace
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:latest
name: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: nginx-namespace
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: nginx
Voulez-vous que j'applique les changements ?
expert > Très bien, voici votre yaml:
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-namespace
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: nginx-namespace
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
sidecar.istio.io/inject: 'true'
name: nginx-deployment
namespace: nginx-namespace
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:latest
name: nginx
ports:
- containerPort: 80
Voulez-vous que j'applique les changements ?
# user > non. ajoute tous les CRDs Istio necessaire pour que le deploiement soit joignable de l'e
expert > Très bien, voici votre yaml:
---
apiVersion: v1
kind: Namespace
metadata:
name: nginx-namespace
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: nginx-namespace
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
sidecar.istio.io/inject: 'true'
name: nginx-deployment
namespace: nginx-namespace
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:latest
name: nginx
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: nginx-gateway
namespace: nginx-namespace
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- '*'
port:
name: http
number: 80
protocol: HTTP
type: LoadBalancer
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx-virtual-service
namespace: nginx-namespace
spec:
gateways:
- nginx-gateway
hosts:
- '*'
http:
- match:
- uri:
prefix: /
- uri:
exact: /favicon.ico
route:
- destination:
host: nginx-service
port:
number: 80
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: nginx-auth-policy
namespace: nginx-namespace
spec:
action: ALLOW
rules:
- from:
- source:
notNamespaces:
- nginx-namespace
selector:
matchLabels:
app: nginx