mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-08-18 21:16:16 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b6c3ec3cf | |||
| 9e3697308e | |||
| af1171a6af | |||
| 17ee9d5040 | |||
| ae85c01b63 | |||
| 8f2f1d7422 |
@@ -1,3 +1,11 @@
|
|||||||
|
## DISCONTINUATION OF PROJECT.
|
||||||
|
|
||||||
|
This project will no longer be maintained by Intel.
|
||||||
|
|
||||||
|
Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.
|
||||||
|
|
||||||
|
Contact: webadmin@linux.intel.com
|
||||||
|
|
||||||
## Cloud Native Setup
|
## Cloud Native Setup
|
||||||
|
|
||||||
Automation around setting up the cloud-native content (Kubernetes) on Clear Linux.
|
Automation around setting up the cloud-native content (Kubernetes) on Clear Linux.
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
resources:
|
||||||
|
- canal/canal.yaml
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: admin-user
|
||||||
|
namespace: kubernetes-dashboard
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: admin-user
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: cluster-admin
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: admin-user
|
||||||
|
namespace: kubernetes-dashboard
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
resources:
|
||||||
|
- dashboard/aio/deploy/recommended.yaml
|
||||||
|
- dashboard-admin.yaml
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
resources:
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/create-logging-namespace.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/es-service.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/es-statefulset.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/fluentd-es-configmap.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/fluentd-es-ds.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/kibana-deployment.yaml
|
||||||
|
- instrumentation-addons/fluentd-elasticsearch/kibana-service.yaml
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
resources:
|
||||||
|
- ingress-nginx/deploy/static/provider/baremetal/deploy.yaml
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
resources:
|
||||||
|
- rook/deploy/examples/cluster.yaml
|
||||||
|
- rook/deploy/examples/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
- probe_timeout.yaml
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
healthCheck:
|
||||||
|
startupProbe:
|
||||||
|
osd:
|
||||||
|
probe:
|
||||||
|
timeoutSeconds: 120
|
||||||
|
initialDelaySeconds: 100
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 10
|
||||||
|
successThreshold: 1
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
resources:
|
||||||
|
- rook/deploy/examples/cluster.yaml
|
||||||
|
- rook/deploy/examples/csi/rbd/storageclass.yaml
|
||||||
|
|
||||||
|
patchesStrategicMerge:
|
||||||
|
# patches rook to use 'directories' instead of partitions.
|
||||||
|
# comment out to use partitions
|
||||||
|
- patch_cephcluster.yaml
|
||||||
|
- probe_timeout.yaml
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
mon:
|
||||||
|
allowMultiplePerNode: true
|
||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephBlockPool
|
||||||
|
metadata:
|
||||||
|
name: replicapool
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
replicated:
|
||||||
|
requireSafeReplicaSize: false
|
||||||
|
size: 1
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
apiVersion: ceph.rook.io/v1
|
||||||
|
kind: CephCluster
|
||||||
|
metadata:
|
||||||
|
name: rook-ceph
|
||||||
|
namespace: rook-ceph
|
||||||
|
spec:
|
||||||
|
healthCheck:
|
||||||
|
startupProbe:
|
||||||
|
mon:
|
||||||
|
probe:
|
||||||
|
timeoutSeconds: 10
|
||||||
|
initialDelaySeconds: 100
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 12
|
||||||
|
successThreshold: 1
|
||||||
|
mgr:
|
||||||
|
probe:
|
||||||
|
timeoutSeconds: 10
|
||||||
|
initialDelaySeconds: 100
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 12
|
||||||
|
successThreshold: 1
|
||||||
|
osd:
|
||||||
|
probe:
|
||||||
|
timeoutSeconds: 10
|
||||||
|
initialDelaySeconds: 100
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 12
|
||||||
|
successThreshold: 1
|
||||||
@@ -18,17 +18,17 @@ LOAD_BALANCER_IP=${LOAD_BALANCER_IP:-""}
|
|||||||
LOAD_BALANCER_PORT="${LOAD_BALANCER_PORT:-6444}"
|
LOAD_BALANCER_PORT="${LOAD_BALANCER_PORT:-6444}"
|
||||||
|
|
||||||
# versions
|
# versions
|
||||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.22}"
|
CANAL_VER="${CLRK8S_CANAL_VER:-v3.24}"
|
||||||
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.9.13}"
|
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.9.13}"
|
||||||
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-v0.16.3}"
|
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-v0.16.3}"
|
||||||
CILIUM_VAL_OVERRIDE=""
|
CILIUM_VAL_OVERRIDE=""
|
||||||
K8S_VER="${CLRK8S_K8S_VER:-}"
|
K8S_VER="${CLRK8S_K8S_VER:-}"
|
||||||
KATA_VER="${CLRK8S_KATA_VER:-2.3.3}"
|
KATA_VER="${CLRK8S_KATA_VER:-2.4.0}"
|
||||||
ROOK_VER="${CLRK8S_ROOK_VER:-v1.8.6}"
|
ROOK_VER="${CLRK8S_ROOK_VER:-v1.8.10}"
|
||||||
METRICS_VER="${CLRK8S_METRICS_VER:-v0.6.1}"
|
METRICS_VER="${CLRK8S_METRICS_VER:-v0.6.1}"
|
||||||
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
|
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.6.1}"
|
||||||
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}"
|
INGRES_VER="${CLRK8S_INGRES_VER:-controller-v1.3.0}"
|
||||||
EFK_VER="${CLRK8S_EFK_VER:-v1.15.1}"
|
EFK_VER="${CLRK8S_EFK_VER:-193692c92eb4667b8f4fb7d4cdf0462e229b5f13}"
|
||||||
METALLB_VER="${CLRK8S_METALLB_VER:-v0.8.3}"
|
METALLB_VER="${CLRK8S_METALLB_VER:-v0.8.3}"
|
||||||
NPD_VER="${CLRK8S_NPD_VER:-v0.6.6}"
|
NPD_VER="${CLRK8S_NPD_VER:-v0.6.6}"
|
||||||
PROMETHEUS_VER="${CLRK8S_PROMETHEUS_VER:-v0.10.0}"
|
PROMETHEUS_VER="${CLRK8S_PROMETHEUS_VER:-v0.10.0}"
|
||||||
@@ -115,9 +115,17 @@ function cluster_init() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Ensure single node k8s works
|
#Ensure single node k8s works both pre and post v1.25
|
||||||
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-
|
minor=$(kubeadm version -o short | cut -f 2 -d "." )
|
||||||
|
if [ $minor -ge "25" ]; then
|
||||||
|
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||||
|
elif [ $minor -eq "24" ]; then
|
||||||
|
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
|
||||||
|
kubectl taint nodes --all node-role.kubernetes.io/master-
|
||||||
|
else
|
||||||
|
kubectl taint nodes --all node-role.kubernetes.io/master-
|
||||||
|
fi
|
||||||
mode="standalone"
|
mode="standalone"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -222,7 +230,7 @@ function storage() {
|
|||||||
ROOK_URL="https://github.com/rook/rook.git"
|
ROOK_URL="https://github.com/rook/rook.git"
|
||||||
ROOK_DIR=7-rook
|
ROOK_DIR=7-rook
|
||||||
|
|
||||||
# This function might be called standalone, so good to check the mode we are in.
|
# This function might be called standalone, so good to check the mode we are in.
|
||||||
if [ "$(kubectl get nodes --no-headers | wc -l)" -eq 1 ]; then
|
if [ "$(kubectl get nodes --no-headers | wc -l)" -eq 1 ]; then
|
||||||
mode="standalone"
|
mode="standalone"
|
||||||
fi
|
fi
|
||||||
@@ -258,10 +266,11 @@ function monitoring() {
|
|||||||
set_repo_version "${PROMETHEUS_VER}" "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus"
|
set_repo_version "${PROMETHEUS_VER}" "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus"
|
||||||
kubectl apply --server-side -f "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus/manifests/setup/"
|
kubectl apply --server-side -f "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus/manifests/setup/"
|
||||||
|
|
||||||
while ! $(kubectl get servicemonitors --all-namespaces) ; do
|
while ! [[ $(kubectl get crd alertmanagers.monitoring.coreos.com prometheuses.monitoring.coreos.com prometheusrules.monitoring.coreos.com servicemonitors.monitoring.coreos.com) ]]; do
|
||||||
echo "Waiting for prometheus crds"
|
echo "Waiting for prometheus crds"
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|
||||||
kubectl apply -k "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/"
|
kubectl apply -k "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/"
|
||||||
|
|
||||||
#Expose the dashboards
|
#Expose the dashboards
|
||||||
@@ -277,6 +286,8 @@ function dashboard() {
|
|||||||
get_repo "${DASHBOARD_URL}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
get_repo "${DASHBOARD_URL}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
||||||
set_repo_version "${DASHBOARD_VER}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}/dashboard"
|
set_repo_version "${DASHBOARD_VER}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}/dashboard"
|
||||||
kubectl apply -k "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
kubectl apply -k "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
||||||
|
|
||||||
|
echo 'Run "kubectl -n kubernetes-dashboard create token admin-user" to create an admin token'
|
||||||
}
|
}
|
||||||
|
|
||||||
function ingres() {
|
function ingres() {
|
||||||
@@ -290,10 +301,10 @@ function ingres() {
|
|||||||
|
|
||||||
function efk() {
|
function efk() {
|
||||||
EFK_VER=${1:-$EFK_VER}
|
EFK_VER=${1:-$EFK_VER}
|
||||||
EFK_URL="https://github.com/kubernetes/kubernetes.git"
|
EFK_URL="https://github.com/kubernetes-sigs/instrumentation-addons.git"
|
||||||
EFK_DIR="3-efk"
|
EFK_DIR="3-efk"
|
||||||
get_repo "${EFK_URL}" "${EFK_DIR}/overlays/${EFK_VER}"
|
get_repo "${EFK_URL}" "${EFK_DIR}/overlays/${EFK_VER}"
|
||||||
set_repo_version "${EFK_VER}" "${EFK_DIR}/overlays/${EFK_VER}/kubernetes"
|
set_repo_version "${EFK_VER}" "${EFK_DIR}/overlays/${EFK_VER}/instrumentation-addons"
|
||||||
kubectl apply -k "${EFK_DIR}/overlays/${EFK_VER}"
|
kubectl apply -k "${EFK_DIR}/overlays/${EFK_VER}"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -354,7 +365,7 @@ function minimal() {
|
|||||||
|
|
||||||
function all() {
|
function all() {
|
||||||
minimal
|
minimal
|
||||||
storage
|
storage
|
||||||
monitoring
|
monitoring
|
||||||
miscellaneous
|
miscellaneous
|
||||||
}
|
}
|
||||||
@@ -395,6 +406,9 @@ command_handlers[npd]=npd
|
|||||||
command_handlers[nfd]=nfd
|
command_handlers[nfd]=nfd
|
||||||
command_handlers[kata]=kata
|
command_handlers[kata]=kata
|
||||||
command_handlers[metrics]=metrics
|
command_handlers[metrics]=metrics
|
||||||
|
command_handlers[dashboard]=dashboard
|
||||||
|
command_handlers[efk]=efk
|
||||||
|
command_handlers[ingres]=ingres
|
||||||
|
|
||||||
declare -A command_help
|
declare -A command_help
|
||||||
command_help[init]="Only inits a cluster using kubeadm"
|
command_help[init]="Only inits a cluster using kubeadm"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: kubeadm.k8s.io/v1beta2
|
apiVersion: kubeadm.k8s.io/v1beta3
|
||||||
kind: InitConfiguration
|
kind: InitConfiguration
|
||||||
---
|
---
|
||||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||||
@@ -11,7 +11,7 @@ kubeReserved:
|
|||||||
cpu: 500m
|
cpu: 500m
|
||||||
memory: 256M
|
memory: 256M
|
||||||
---
|
---
|
||||||
apiVersion: kubeadm.k8s.io/v1beta2
|
apiVersion: kubeadm.k8s.io/v1beta3
|
||||||
kind: ClusterConfiguration
|
kind: ClusterConfiguration
|
||||||
networking:
|
networking:
|
||||||
dnsDomain: cluster.local
|
dnsDomain: cluster.local
|
||||||
|
|||||||
Reference in New Issue
Block a user