change port

pull/10427/head
Medya Gh 2021-02-08 16:24:29 -08:00
parent 72135d70d9
commit a3f5f754fe
4 changed files with 103 additions and 1 deletions

View File

@ -0,0 +1,60 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: auto-pause
namespace: kube-system
labels:
app: auto-pause
spec:
replicas: 1
selector:
matchLabels:
app: auto-pause
template:
metadata:
creationTimestamp: null
labels:
app: auto-pause
spec:
volumes:
- name: hacfg
hostPath:
path: /var/lib/minikube/ha.cfg
type: File
containers:
- name: auto-pause
image: "haproxy"
ports:
- name: https
containerPort: 38443
protocol: TCP
volumeMounts:
- name: hacfg
mountPath: /usr/local/etc/haproxy/haproxy.cfg
readOnly: true
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 250m
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
name: auto-pause
namespace: kube-system
labels:
app: auto-pause
spec:
ports:
- name: https-38443
port: 38443
protocol: TCP
targetPort: 38443
nodePort: 32443
selector:
app: auto-pause
type: NodePort

View File

@ -0,0 +1,38 @@
#---------------------------------------------------------------------
# Configure HAProxy for Kubernetes API Server
#---------------------------------------------------------------------
listen stats
bind *:9000
mode http
stats enable
stats hide-version
stats uri /stats
stats refresh 30s
stats realm Haproxy\ Statistics
stats auth Admin:Password
option httplog
# change haproxy.cfg file with the following
global
log stdout local0 debug
defaults
log global
option httplog
############## Configure HAProxy Secure Frontend #############
frontend k8s-api-https-proxy
bind 0.0.0.0:38443
mode tcp
tcp-request inspect-delay 5s
tcp-request content accept if { req.ssl_hello_type 1 }
default_backend k8s-api-https
############## Configure HAProxy SecureBackend #############
backend k8s-api-https
balance roundrobin
mode tcp
option tcplog
option tcp-check
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
server k8s-api-1 192.168.49.2:8443 check

View File

@ -0,0 +1,4 @@
## Running in docker
```
docker run -p 38443:38443 -v $(pwd):/t -it --rm --name haproxy haproxy -f /t/haproxy.cfg
```

View File

@ -42,7 +42,7 @@ const (
// APIServerPort is the default API server port
APIServerPort = 8443
// AutoPauseProxyPort is the port to be used as a reverse proxy for apiserver port
AutoPauseProxyPort = 38443
AutoPauseProxyPort = 32443
// SSHPort is the SSH serviceport on the node vm and container
SSHPort = 22