roles/k3s/files: update

This commit is contained in:
Haitao Pan 2023-03-23 23:10:58 +08:00
parent 5024a39ced
commit 4d46cc1872
3 changed files with 12 additions and 46 deletions

View File

@ -20,7 +20,7 @@ alibabacloud:
EOF
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create namespace external-dns
helm upgrade --install external-dns -f external-dns-values.yaml bitnami/external-dns -n external-dns
sudo helm repo add bitnami https://charts.bitnami.com/bitnami || echo true
sudo helm repo update
sudo kubectl create namespace external-dns || echo true
sudo helm upgrade --install external-dns -f external-dns-values.yaml bitnami/external-dns -n external-dns

View File

@ -1,10 +1,6 @@
#!/bin/bash
ip=$1
helm repo add nginx-stable https://helm.nginx.com/stable
helm repo up
kubectl create namespace ingress
cat > value.yaml <<EOF
controller:
nginxplus: false
@ -16,7 +12,6 @@ controller:
externalIPs:
- $ip
EOF
helm upgrade --install nginx nginx-stable/nginx-ingress --version=0.15.0 --namespace ingress -f value.yaml
cat > nginx-cm.yaml << EOF
apiVersion: v1
@ -31,7 +26,6 @@ data:
proxy-read-timeout: 10s
EOF
cat > nginx-svc-patch.yaml << EOF
spec:
ports:
@ -47,37 +41,9 @@ spec:
targetPort: 443
EOF
kubectl apply -f nginx-cm.yaml
kubectl patch svc nginx-nginx-ingress -n ingress --patch-file nginx-svc-patch.yaml
cat > tcp-service-crd.yaml << EOF
apiVersion: k8s.nginx.org/v1alpha1
kind: GlobalConfiguration
metadata:
name: nginx-configuration
namespace: ingress
spec:
listeners:
- name: gitlab-tcp
port: 22
protocol: TCP
---
apiVersion: k8s.nginx.org/v1alpha1
kind: TransportServer
metadata:
name: gitlab-tcp-proxy
namespace: gitlab
spec:
listener:
name: gitlab-tcp
protocol: TCP
upstreams:
- name: gitlab-shell-svc
service: gitlab-gitlab-shell
port: 22
action:
pass: gitlab-shell-svc
EOF
kubectl apply -f tcp-service-crd.yaml
#
# https://www.nginx.com/blog/load-balancing-tcp-and-udp-traffic-in-kubernetes-with-nginx/
sudo helm repo add nginx-stable https://helm.nginx.com/stable || echo true
sudo helm repo up
sudo kubectl create namespace ingress || echo true
sudo helm upgrade --install nginx nginx-stable/nginx-ingress --version=0.15.0 --namespace ingress -f value.yaml
sudo kubectl apply -f nginx-cm.yaml
sudo kubectl patch svc nginx-nginx-ingress -n ingress --patch-file nginx-svc-patch.yaml

View File

@ -9,5 +9,5 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.24.7+k3s1 sh -s - \
#export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
sudo wget --no-check-certificate https://mirrors.onwalk.net/tools/linux-amd64/helm.tar.gz && sudo tar -xvpf helm.tar.gz -C /usr/local/bin/
sudo chmod 755 /usr/local/bin/helm
helm repo add artifact https://artifact.onwalk.net/chartrepo/k8s/
helm repo up
sudo helm repo add artifact https://artifact.onwalk.net/chartrepo/k8s/ | echo true
sudo helm repo up