zackzhang
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: test-app
namespace: test-istio
labels:
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
annotations:
servicemesh.kubesphere.io/enabled: 'true'
spec:
selector:
matchLabels:
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
addOwnerRef: true
componentKinds:
- group: ''
kind: Service
- group: apps
kind: Deployment
- group: apps
kind: StatefulSet
- group: extensions
kind: Ingress
- group: servicemesh.kubesphere.io
kind: Strategy
- group: servicemesh.kubesphere.io
kind: ServicePolicy
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: test-istio
labels:
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
name: test-app-ingress-mjaz7h
annotations:
nginx.ingress.kubernetes.io/upstream-vhost: httpd.test-istio.svc.cluster.local
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: httpd
servicePort: 8000
host: httpd.test-istio.undefined.nip.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: test-istio
labels:
version: v1
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
name: httpd-v1
annotations:
servicemesh.kubesphere.io/enabled: 'true'
spec:
replicas: 2
selector:
matchLabels:
version: v1
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
template:
metadata:
labels:
version: v1
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
annotations:
kubesphere.io/containerSecrets: null
sidecar.istio.io/inject: 'true'
spec:
containers:
- name: container-0c4n1y
imagePullPolicy: IfNotPresent
image: 'wenbingzhang/httpserver:v1'
ports:
- name: http-httpserver
protocol: TCP
containerPort: 8000
servicePort: 8000
command:
- /usr/local/bin/httpd
serviceAccount: default
affinity: {}
initContainers: []
volumes: []
imagePullSecrets: null
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
---
apiVersion: v1
kind: Service
metadata:
namespace: test-istio
labels:
version: v1
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
annotations:
kubesphere.io/serviceType: statelessservice
servicemesh.kubesphere.io/enabled: 'true'
name: httpd
spec:
sessionAffinity: None
selector:
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
template:
metadata:
labels:
version: v1
app: httpd
app.kubernetes.io/version: v1
app.kubernetes.io/name: test-app
ports:
- name: http-httpserver
protocol: TCP
port: 8000
targetPort: 8000
type: NodePort
这是我构建应用的yaml,我看到默认就已经添加注解nginx.ingress.kubernetes.io/upstream-vhost,最后我是使用NodePort访问的。