feat: 🚛 完成了 client 资源创建
This commit is contained in:
28
pkg/resource/nginx/client_pkg.conf
Normal file
28
pkg/resource/nginx/client_pkg.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
user root;
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format custom '$time_iso8601 - $remote_addr - $http_host - $status - $request_time - $request_method - $request_uri';
|
||||
access_log /var/log/nginx/access.log custom;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
|
||||
gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location %s {
|
||||
alias /data;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,9 @@ var (
|
||||
//go:embed yaml/app.nginx.yaml
|
||||
YAMLAppNGINX string
|
||||
|
||||
//go:embed yaml/client.pkg.yaml
|
||||
YAMLClientPKG string
|
||||
|
||||
//go:embed ssl/ca.crt
|
||||
SSLCaCrt string
|
||||
|
||||
@@ -127,4 +130,7 @@ var (
|
||||
|
||||
//go:embed nginx/user.conf
|
||||
NGINXUser []byte
|
||||
|
||||
//go:embed nginx/client_pkg.conf
|
||||
NGINXClientPKG string
|
||||
)
|
||||
|
||||
42
pkg/resource/yaml/client.pkg.yaml
Normal file
42
pkg/resource/yaml/client.pkg.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: client-__os__-deployment
|
||||
namespace: hsv2
|
||||
spec:
|
||||
replicas: %d
|
||||
selector:
|
||||
matchLabels:
|
||||
app: client-__os__
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: client-__os__
|
||||
spec:
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: kubernetes.io/hostname
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: client-__os__
|
||||
containers:
|
||||
- name: client-__os__
|
||||
image: %s
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: client-__os__-service
|
||||
namespace: hsv2
|
||||
spec:
|
||||
selector:
|
||||
app: client-__os__
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
type: ClusterIP
|
||||
@@ -54,7 +54,7 @@ metadata:
|
||||
namespace: db-registry
|
||||
spec:
|
||||
clusterIP: 10.96.123.45
|
||||
type: NodePork
|
||||
type: NodePort
|
||||
selector:
|
||||
app: registry
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user