mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-08-19 05:27:26 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df50ad11ce | |||
| cf9b85cf03 | |||
| a82b9d9601 | |||
| 96978c5228 | |||
| 8c17c4b47c | |||
| 514efd6592 | |||
| 603c42703f | |||
| 52d1a8406b | |||
| 61b8702472 |
Vendored
+56
@@ -0,0 +1,56 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
label 'clearlinux'
|
||||||
|
}
|
||||||
|
options {
|
||||||
|
timeout(time: 1, unit: "HOURS")
|
||||||
|
}
|
||||||
|
triggers {
|
||||||
|
cron('H */12 * * *')
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
CLR_K8S_PATH="${env.WORKSPACE}/clr-k8s-examples"
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Setup system') {
|
||||||
|
steps {
|
||||||
|
dir(path: "$CLR_K8S_PATH") {
|
||||||
|
sh './setup_system.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Init') {
|
||||||
|
steps {
|
||||||
|
dir(path: "$CLR_K8S_PATH") {
|
||||||
|
sh './create_stack.sh init'
|
||||||
|
sh 'mkdir -p $HOME/.kube'
|
||||||
|
sh 'sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config'
|
||||||
|
sh 'sudo chown $(id -u):$(id -g) $HOME/.kube/config'
|
||||||
|
sh 'kubectl version'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('CNI') {
|
||||||
|
steps {
|
||||||
|
dir(path: "$CLR_K8S_PATH") {
|
||||||
|
sh './create_stack.sh cni'
|
||||||
|
sh 'kubectl rollout status deployment/coredns -n kube-system --timeout=5m'
|
||||||
|
sh 'kubectl get pods -n kube-system'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Reset Stack') {
|
||||||
|
steps {
|
||||||
|
dir(path: "$CLR_K8S_PATH") {
|
||||||
|
sh './reset_stack.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh 'uname -a'
|
||||||
|
sh 'swupd info'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
resources:
|
||||||
|
- flannel/Documentation/kube-flannel.yml
|
||||||
+4
@@ -1,7 +1,11 @@
|
|||||||
resources:
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
- rook/cluster/examples/kubernetes/ceph/storageclass.yaml
|
- rook/cluster/examples/kubernetes/ceph/storageclass.yaml
|
||||||
|
|
||||||
patchesStrategicMerge:
|
patchesStrategicMerge:
|
||||||
- patch_operator.yaml
|
- patch_operator.yaml
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: ceph.rook.io/v1
|
apiVersion: ceph.rook.io/v1
|
||||||
kind: CephCluster
|
kind: CephCluster
|
||||||
metadata:
|
metadata:
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
mon:
|
||||||
|
allowMultiplePerNode: true
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephBlockPool
|
||||||
|
metadata:
|
||||||
|
name: replicapool
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
replicated:
|
||||||
|
requireSafeReplicaSize: false
|
||||||
|
size: 1
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: ceph.rook.io/v1
|
apiVersion: ceph.rook.io/v1
|
||||||
kind: CephCluster
|
kind: CephCluster
|
||||||
metadata:
|
metadata:
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
mon:
|
||||||
|
allowMultiplePerNode: true
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephBlockPool
|
||||||
|
metadata:
|
||||||
|
name: replicapool
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
replicated:
|
||||||
|
requireSafeReplicaSize: false
|
||||||
|
size: 1
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
mon:
|
||||||
|
allowMultiplePerNode: true
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephBlockPool
|
||||||
|
metadata:
|
||||||
|
name: replicapool
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
replicated:
|
||||||
|
requireSafeReplicaSize: false
|
||||||
|
size: 1
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
resources:
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/common.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/operator.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/cluster.yaml
|
||||||
|
- rook/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
mon:
|
||||||
|
allowMultiplePerNode: true
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/rook
|
||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephBlockPool
|
||||||
|
metadata:
|
||||||
|
name: replicapool
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
replicated:
|
||||||
|
requireSafeReplicaSize: false
|
||||||
|
size: 1
|
||||||
@@ -38,7 +38,7 @@ add_pair_ns() {
|
|||||||
ln -sfT $CNI_NETNS /var/run/netns/$CNI_CONTAINERID
|
ln -sfT $CNI_NETNS /var/run/netns/$CNI_CONTAINERID
|
||||||
|
|
||||||
ip netns exec $CNI_CONTAINERID ip link add $CNI_IFNAME type veth peer name $peer
|
ip netns exec $CNI_CONTAINERID ip link add $CNI_IFNAME type veth peer name $peer
|
||||||
ip netns exec $CNI_CONTAINERID ip link set $CNI_IFNAME addr $mac up
|
ip netns exec $CNI_CONTAINERID ip link set $CNI_IFNAME addr $mac up alias $vfpci
|
||||||
ip netns exec $CNI_CONTAINERID ip link set $peer up
|
ip netns exec $CNI_CONTAINERID ip link set $peer up
|
||||||
ip netns exec $CNI_CONTAINERID ip addr add $ip dev $CNI_IFNAME
|
ip netns exec $CNI_CONTAINERID ip addr add $ip dev $CNI_IFNAME
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,3 +162,18 @@ Grafana is available at this URL http://localhost:3000 . Default credentials are
|
|||||||
## Cleaning up the cluster (Hard reset to a clean state)
|
## Cleaning up the cluster (Hard reset to a clean state)
|
||||||
|
|
||||||
Run `reset_stack.sh` on all the nodes
|
Run `reset_stack.sh` on all the nodes
|
||||||
|
|
||||||
|
## Additional Components
|
||||||
|
|
||||||
|
### Rook
|
||||||
|
The default Rook configuration provided is intended for testing purposes only
|
||||||
|
and is not suitable for a production environment. By default Rook is configured
|
||||||
|
to provide local storage (/var/lib/rook) and will be provisioned differently
|
||||||
|
depending on whether or not you startup a single node Kubernetes cluster, or
|
||||||
|
a multiple node Kubernetes cluster.
|
||||||
|
|
||||||
|
- When starting up a single node Kubernetes cluster, Rook will be configured
|
||||||
|
to start up a single replica, and will allow multiple monitors on the same node.
|
||||||
|
- When multiple Kubernetes worker nodes are detected, Rook will be configured
|
||||||
|
to startup a replica on each available node and will schedule monitor processes
|
||||||
|
on separate nodes providing greater reliability.
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
|
|||||||
# versions
|
# versions
|
||||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}"
|
CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}"
|
||||||
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6.4}"
|
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6.4}"
|
||||||
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-16b0fe66285d1ad1f42b154ab852682f6fafb1a7}"
|
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-960b3243b9a7faccdfe7b3c09097105e68030ea7}"
|
||||||
K8S_VER="${CLRK8S_K8S_VER:-}"
|
K8S_VER="${CLRK8S_K8S_VER:-}"
|
||||||
KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}"
|
KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}"
|
||||||
ROOK_VER="${CLRK8S_ROOK_VER:-v1.1.7}"
|
ROOK_VER="${CLRK8S_ROOK_VER:-v1.2.6}"
|
||||||
METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.6}"
|
METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.6}"
|
||||||
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
|
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
|
||||||
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}"
|
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}"
|
||||||
@@ -33,6 +33,7 @@ CNI=${CLRK8S_CNI:-"canal"}
|
|||||||
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-"crio"}"; fi
|
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-"crio"}"; fi
|
||||||
|
|
||||||
NFD_VER="${CLRK8S_NFD_VER:-v0.4.0}"
|
NFD_VER="${CLRK8S_NFD_VER:-v0.4.0}"
|
||||||
|
mode="multinode"
|
||||||
|
|
||||||
function print_usage_exit() {
|
function print_usage_exit() {
|
||||||
exit_code=${1:-0}
|
exit_code=${1:-0}
|
||||||
@@ -108,6 +109,7 @@ function cluster_init() {
|
|||||||
#Ensure single node k8s works
|
#Ensure single node k8s works
|
||||||
if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then
|
if [ "$(kubectl get nodes | wc -l)" -eq 2 ]; then
|
||||||
kubectl taint nodes --all node-role.kubernetes.io/master-
|
kubectl taint nodes --all node-role.kubernetes.io/master-
|
||||||
|
mode="standalone"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ function cni() {
|
|||||||
|
|
||||||
function metrics() {
|
function metrics() {
|
||||||
METRICS_VER="${1:-$METRICS_VER}"
|
METRICS_VER="${1:-$METRICS_VER}"
|
||||||
METRICS_URL="https://github.com/kubernetes-incubator/metrics-server.git"
|
METRICS_URL="https://github.com/kubernetes-sigs/metrics-server.git"
|
||||||
METRICS_DIR="1-core-metrics"
|
METRICS_DIR="1-core-metrics"
|
||||||
get_repo "${METRICS_URL}" "${METRICS_DIR}/overlays/${METRICS_VER}"
|
get_repo "${METRICS_URL}" "${METRICS_DIR}/overlays/${METRICS_VER}"
|
||||||
set_repo_version "${METRICS_VER}" "${METRICS_DIR}/overlays/${METRICS_VER}/metrics-server"
|
set_repo_version "${METRICS_VER}" "${METRICS_DIR}/overlays/${METRICS_VER}/metrics-server"
|
||||||
@@ -208,9 +210,9 @@ function storage() {
|
|||||||
ROOK_DIR=7-rook
|
ROOK_DIR=7-rook
|
||||||
|
|
||||||
# get and apply rook
|
# get and apply rook
|
||||||
get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}"
|
get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}"
|
||||||
set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/rook"
|
set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook"
|
||||||
kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}"
|
kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}"
|
||||||
# wait for the rook OSDs to run which means rooks should be ready
|
# wait for the rook OSDs to run which means rooks should be ready
|
||||||
while [[ $(kubectl get po --all-namespaces | grep -e 'osd.*Running.*' -c) -lt 1 ]]; do
|
while [[ $(kubectl get po --all-namespaces | grep -e 'osd.*Running.*' -c) -lt 1 ]]; do
|
||||||
echo "Waiting for Rook OSD"
|
echo "Waiting for Rook OSD"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
@@ -9,14 +8,15 @@ CLR_VER=${CLRK8S_CLR_VER:-""}
|
|||||||
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
|
HIGH_POD_COUNT=${HIGH_POD_COUNT:-""}
|
||||||
|
|
||||||
# set no proxy
|
# set no proxy
|
||||||
ADD_NO_PROXY=".svc,10.0.0.0/8,192.168.0.0/16"
|
NO_PROXY_ARRAY=(.svc 10.0.0.0/8 )
|
||||||
ADD_NO_PROXY+=",$(hostname -I | sed 's/[[:space:]]/,/g')"
|
NO_PROXY_ARRAY+=( $(hostname -I | awk -F. '{print $1"."$2"."$3".0/24"}'))
|
||||||
|
|
||||||
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-crio}"; fi
|
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-crio}"; fi
|
||||||
|
|
||||||
# update os version
|
# update os version
|
||||||
function upate_os_version() {
|
function upate_os_version() {
|
||||||
if [[ -n "${CLR_VER}" ]]; then
|
if [[ -n "${CLR_VER}" ]]; then
|
||||||
sudo swupd repair -m "${CLR_VER}" --picky
|
sudo swupd repair -m "${CLR_VER}" --picky --force
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
sudo swupd update
|
sudo swupd update
|
||||||
@@ -144,9 +144,15 @@ function ensure_system_ready() {
|
|||||||
# add proxy if found
|
# add proxy if found
|
||||||
function setup_proxy() {
|
function setup_proxy() {
|
||||||
set +o nounset
|
set +o nounset
|
||||||
|
set +o errexit
|
||||||
if [[ ${http_proxy} ]] || [[ ${HTTP_PROXY} ]]; then
|
if [[ ${http_proxy} ]] || [[ ${HTTP_PROXY} ]]; then
|
||||||
echo "Setting up proxy stuff...."
|
echo "Setting up proxy stuff...."
|
||||||
# Setup IP for users too
|
# Setup IP for users too
|
||||||
|
for ip in "${NO_PROXY_ARRAY[@]}"
|
||||||
|
do
|
||||||
|
result=`grep no_proxy /etc/profile.d/proxy.sh | grep $ip`
|
||||||
|
[ -z "$result" ] && ADD_NO_PROXY+="$ip,"
|
||||||
|
done
|
||||||
sed_val=${ADD_NO_PROXY//\//\\/}
|
sed_val=${ADD_NO_PROXY//\//\\/}
|
||||||
[ -f /etc/environment ] && sudo sed -i "/no_proxy/I s/$/,${sed_val}/g" /etc/environment
|
[ -f /etc/environment ] && sudo sed -i "/no_proxy/I s/$/,${sed_val}/g" /etc/environment
|
||||||
if [ -f /etc/profile.d/proxy.sh ]; then
|
if [ -f /etc/profile.d/proxy.sh ]; then
|
||||||
@@ -155,19 +161,18 @@ function setup_proxy() {
|
|||||||
echo "Warning, failed to find /etc/profile.d/proxy.sh to edit no_proxy line"
|
echo "Warning, failed to find /etc/profile.d/proxy.sh to edit no_proxy line"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
services=("${RUNNER}" 'kubelet')
|
cat <<EOF | sudo bash -c "cat > /usr/lib/systemd/system.conf.d/proxy.conf"
|
||||||
for s in "${services[@]}"; do
|
[Manager]
|
||||||
sudo mkdir -p "/etc/systemd/system/${s}.service.d/"
|
DefaultEnvironment="HTTP_PROXY=${http_proxy}"
|
||||||
cat <<EOF | sudo bash -c "cat > /etc/systemd/system/${s}.service.d/proxy.conf"
|
DefaultEnvironment="HTTPS_PROXY=${https_proxy}"
|
||||||
[Service]
|
DefaultEnvironment="SOCKS_PROXY=${socks_proxy}"
|
||||||
Environment="HTTP_PROXY=${http_proxy}"
|
DefaultEnvironment="NO_PROXY=${no_proxy},${ADD_NO_PROXY}"
|
||||||
Environment="HTTPS_PROXY=${https_proxy}"
|
|
||||||
Environment="SOCKS_PROXY=${socks_proxy}"
|
|
||||||
Environment="NO_PROXY=${no_proxy},${ADD_NO_PROXY}"
|
|
||||||
EOF
|
EOF
|
||||||
done
|
|
||||||
|
sudo systemctl daemon-reexec
|
||||||
fi
|
fi
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
set -o errexit
|
||||||
}
|
}
|
||||||
|
|
||||||
# init for performing any pre tasks
|
# init for performing any pre tasks
|
||||||
|
|||||||
Reference in New Issue
Block a user