Commit c1094b3e by tingweiwang

fix

1 parent da7cc154
#!/bin/bash #!/bin/bash
#wangtingwei #wangtingwei
kubectl create secret -n ingress-nginx tls autodl-secret --key /root/ingress/autodl-cert/autodl.com.key --cert /root/ngress/autodl-cert/autodl.com.pem kubectl create secret -n autodl tls autodl-secret --key /root/ingress/autodl-cert/autodl.com.key --cert /root/ingress/autodl-cert/autodl.com.pem
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-ingress-controller
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
template:
metadata:
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
annotations:
prometheus.io/port: "10254"
prometheus.io/scrape: "true"
spec:
# wait up to five minutes for the drain of connections
terminationGracePeriodSeconds: 300
serviceAccountName: nginx-ingress-serviceaccount
nodeSelector:
beta.kubernetes.io/os: linux
containers:
- name: nginx-ingress-controller
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-configuration
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
- --publish-service=$(POD_NAMESPACE)/ingress-nginx
- --annotations-prefix=nginx.ingress.kubernetes.io
securityContext:
allowPrivilegeEscalation: true
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
# www-data -> 33
runAsUser: 33
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10254
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
lifecycle:
preStop:
exec:
command:
- /wait-shutdown
apiVersion: v1
kind: Namespace
metadata:
name: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
---
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
---
kind: ConfigMap
apiVersion: v1
metadata:
name: tcp-services
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
---
kind: ConfigMap
apiVersion: v1
metadata:
name: udp-services
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-ingress-serviceaccount
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: nginx-ingress-clusterrole
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- nodes
- pods
- secrets
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- "extensions"
- "networking.k8s.io"
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- "extensions"
- "networking.k8s.io"
resources:
- ingresses/status
verbs:
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: nginx-ingress-role
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- secrets
- namespaces
verbs:
- get
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
# Defaults to "<election-id>-<ingress-class>"
# Here: "<ingress-controller-leader>-<nginx>"
# This has to be adapted if you change either parameter
# when launching the nginx-ingress-controller.
- "ingress-controller-leader-nginx"
verbs:
- get
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: nginx-ingress-role-nisa-binding
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: nginx-ingress-role
subjects:
- kind: ServiceAccount
name: nginx-ingress-serviceaccount
namespace: ingress-nginx
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: nginx-ingress-clusterrole-nisa-binding
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: nginx-ingress-clusterrole
subjects:
- kind: ServiceAccount
name: nginx-ingress-serviceaccount
namespace: ingress-nginx
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: 80
nodePort: 30097
protocol: TCP
- name: https
port: 443
targetPort: 443
nodePort: 30098
protocol: TCP
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: autodl-ingress
namespace: autodl
######################添加annotation修改nginx配置信息,解决上传文件413 too large限制################
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "102400m"
#####################################################################################################
spec:
tls:
- hosts:
- admin.autodl.com
- admin-backend.autodl.com
- proxy.autodl.com
- fs.autodl.com
- api.autodl.com
- www.autodl.com
- user-frontend.autodl.com
- user-backend.autodl.com
- core-nginx.autodl.com
secretName: autodl-secret
rules:
- host: www.autodl.com
http:
paths:
- backend:
serviceName: autodl--frontend
servicePort: 80 #port
- host: api.autodl.com
http:
paths:
- backend:
serviceName: autodl--nginx
servicePort: 30091
- host: fs.autodl.com
http:
paths:
- backend:
serviceName: autodl--nginx
servicePort: 30093
- host: admin.autodl.com
http:
paths:
- backend:
serviceName: autodl--admin-frontend
servicePort: 80 #port
- host: admin-backend.autodl.com
http:
paths:
- backend:
serviceName: autodl--nginx
servicePort: 30092
- host: proxy.autodl.com
http:
paths:
- backend:
serviceName: autodl--nginx
servicePort: 30094
###################seetaas业务在autodl命名空间的组件#############################
- host: user-frontend.autodl.com
http:
paths:
- backend:
serviceName: user-center--nginx-svc
servicePort: 30302
- host: user-backend.autodl.com
http:
paths:
- backend:
serviceName: user-center--nginx-svc
servicePort: 30300
- host: core-nginx.autodl.com
http:
paths:
- backend:
serviceName: core--nginx-svc
servicePort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kpl-ingress
namespace: kpl
######################添加annotation修改nginx配置信息,解决上传文件413 too large限制################
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "102400m"
###########################################################################
spec:
tls:
- hosts:
- seetaas.seetatech.com
- backend.seetatech.com
- image.seetatech.com
- deploy.seetatech.com
# - user-frontend.seetatech.com
# - user-backend.seetatech.com
# - core-nginx.seetatech.com
- mobile-frontend.seetatech.com
secretName: kpl-secret
rules:
- host: seetaas.seetatech.com
http:
paths:
- backend:
serviceName: kpl--frontend
servicePort: 80
- host: backend.seetatech.com
http:
paths:
- backend:
serviceName: kpl--nginx-svc
servicePort: 80
- host: image.seetatech.com
http:
paths:
- backend:
serviceName: kpl--nginx-svc
servicePort: 82
- host: deploy.seetatech.com
http:
paths:
- backend:
serviceName: kpl--nginx-svc
servicePort: 81
- host: mobile-frontend.seetatech.com
http:
paths:
- backend:
serviceName: kpl--frontend
servicePort: 81
# - host: user-frontend.seetatech.com
# http:
# paths:
# - backend:
# serviceName: user-center--nginx-svc
# servicePort: 30302
# - host: user-backend.seetatech.com
# http:
# paths:
# - backend:
# serviceName: user-center--nginx-svc
# servicePort: 30300
# - host: core-nginx.seetatech.com
# http:
# paths:
# - backend:
# serviceName: core--nginx-svc
# servicePort: 80
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: seetaas-ingress
namespace: seetaas
######################添加annotation修改nginx配置信息,解决上传文件413 too large限制################
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "102400m"
###########################################################################
spec:
tls:
- hosts:
- seetaas.seetatech.com
- backend.seetatech.com
- image.seetatech.com
- deploy.seetatech.com
- user-frontend.seetatech.com
- user-backend.seetatech.com
- core-nginx.seetatech.com
- mobile-frontend.seetatech.com
secretName: seetaas-secret
rules:
- host: seetaas.seetatech.com
http:
paths:
- backend:
serviceName: seetaas--frontend
servicePort: 80
- host: backend.seetatech.com
http:
paths:
- backend:
serviceName: seetaas--nginx-svc
servicePort: 80
- host: image.seetatech.com
http:
paths:
- backend:
serviceName: seetaas--nginx-svc
servicePort: 82
- host: deploy.seetatech.com
http:
paths:
- backend:
serviceName: seetaas--nginx-svc
servicePort: 81
- host: user-frontend.seetatech.com
http:
paths:
- backend:
serviceName: user-center--nginx-svc
servicePort: 30302
- host: user-backend.seetatech.com
http:
paths:
- backend:
serviceName: user-center--nginx-svc
servicePort: 30300
- host: core-nginx.seetatech.com
http:
paths:
- backend:
serviceName: core--nginx-svc
servicePort: 80
- host: mobile-frontend.seetatech.com
http:
paths:
- backend:
serviceName: seetaas--frontend
servicePort: 81
#!/bin/bash
kubectl create secret -n kpl tls kpl-secret --key /root/ingress/seetaas-cert/seetatech.com.key --cert /root/ingress/seetaas-cert/seetatech.com.pem
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!