赞
踩
apiVersion: apps/v1 kind: Deployment metadata: name: $APPNAME namespace: $NAMESPACE spec: replicas: 2 selector: matchLabels: appname: $APPNAME template: metadata: annotations: prometheus.io/path: "/actuator/prometheus" prometheus.io/port: "80" prometheus.io/scrape: "true" labels: appname: $APPNAME spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchExpressions: - key: appname operator: In values: - $APPNAME topologyKey: kubernetes.io/hostname weight: 50 containers: - name: $APPNAME image: $IMAGENAME ports: - containerPort: 80 readinessProbe: failureThreshold: 3 #探测失败的重试次数,重试一定次数后将认为失败 httpGet: path: / port: 80 scheme: HTTP initialDelaySeconds: 60 #容器启动后要等待多少秒后探测 periodSeconds: 10 #执行探测的时间间隔 successThreshold: 1 #探测成功次数 timeoutSeconds: 1 #探针执行检测请求后,等待响应的超时时间 resources: requests: cpu: 200m memory: 512Mi limits: cpu: 200m memory: 512Mi --- apiVersion: v1 kind: Service metadata: annotations: blackbox_path: "/" blackbox_port: "80" blackbox_scheme: "http" name: $APPNAME namespace: $NAMESPACE spec: selector: appname: $APPNAME ports: - port: 80 protocol: TCP targetPort: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: $APPNAME namespace: $NAMESPACE annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/proxy-body-size: "1000m" spec: rules: - host: $URL http: paths: - path: / pathType: ImplementationSpecific backend: service: name: $APPNAME port: number: 80
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-xia namespace: xia spec: replicas: 2 selector: matchLabels: appname: nginx-xia template: metadata: annotations: prometheus.io/path: "/actuator/prometheus" prometheus.io/port: "80" prometheus.io/scrape: "true" labels: appname: nginx-xia spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchExpressions: - key: appname operator: In values: - nginx-xia topologyKey: kubernetes.io/hostname weight: 50 containers: - name: nginx-xia image: harbor.wuxing.com/library/nginx:alpine-base ports: - containerPort: 80 readinessProbe: failureThreshold: 3 httpGet: path: / port: 80 scheme: HTTP initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 resources: requests: cpu: 200m memory: 512Mi limits: cpu: 200m memory: 512Mi --- apiVersion: v1 kind: Service metadata: annotations: blackbox_path: "/" blackbox_port: "80" blackbox_scheme: "http" name: nginx-xia namespace: xia spec: selector: appname: nginx-xia ports: - port: 80 protocol: TCP targetPort: 80 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nginx-xia namespace: xia annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/proxy-body-size: "1000m" spec: rules: - host: xia.wuxingge.com http: paths: - path: / pathType: ImplementationSpecific backend: service: name: nginx-xia port: number: 80
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。