mirror of
https://github.com/clearlinux/cloud-native-setup.git
synced 2026-08-18 21:16:16 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e3697308e | |||
| af1171a6af | |||
| 17ee9d5040 | |||
| ae85c01b63 | |||
| 8f2f1d7422 | |||
| 32f421a2f9 | |||
| 6aff0ac601 | |||
| 0d1d72e7a1 | |||
| dc39af186f | |||
| 6b56a905a6 |
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- canal/canal.yaml
|
||||
@@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- canal/canal.yaml
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- canal/canal.yaml
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
cilium/cilium.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
ipam:
|
||||
mode: "cluster-pool"
|
||||
operator:
|
||||
clusterPoolIPv4PodCIDR: "10.244.0.0/16"
|
||||
clusterPoolIPv4MaskSize: 24
|
||||
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- flannel/Documentation/kube-flannel.yml
|
||||
@@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- flannel/Documentation/kube-flannel.yml
|
||||
@@ -0,0 +1,8 @@
|
||||
resources:
|
||||
- components.yaml
|
||||
patchesJson6902:
|
||||
- target:
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: metrics-server
|
||||
path: patch_metricstls.yaml
|
||||
@@ -0,0 +1,3 @@
|
||||
- op: add
|
||||
path: "/spec/template/spec/containers/0/args/-"
|
||||
value: --kubelet-insecure-tls
|
||||
@@ -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,76 @@
|
||||
resources:
|
||||
- kube-prometheus/manifests/kubeStateMetrics-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-clusterRole.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/prometheus-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-serviceMonitorKubeScheduler.yaml
|
||||
- kube-prometheus/manifests/prometheus-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/grafana-dashboardSources.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/kubePrometheus-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/prometheus-clusterRole.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/prometheus-roleSpecificNamespaces.yaml
|
||||
- kube-prometheus/manifests/alertmanager-service.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-service.yaml
|
||||
- kube-prometheus/manifests/prometheus-roleConfig.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-clusterRole.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-deployment.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-deployment.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-serviceMonitorApiserver.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-configMap.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-deployment.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-configuration.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/grafana-dashboardDefinitions.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-service.yaml
|
||||
- kube-prometheus/manifests/grafana-service.yaml
|
||||
- kube-prometheus/manifests/prometheus-prometheus.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-serviceMonitorKubeControllerManager.yaml
|
||||
- kube-prometheus/manifests/alertmanager-alertmanager.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-serviceMonitorKubelet.yaml
|
||||
- kube-prometheus/manifests/grafana-dashboardDatasources.yaml
|
||||
- kube-prometheus/manifests/kubernetesControlPlane-serviceMonitorCoreDNS.yaml
|
||||
- kube-prometheus/manifests/alertmanager-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/grafana-deployment.yaml
|
||||
- kube-prometheus/manifests/grafana-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/alertmanager-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-clusterRoleAggregatedMetricsReader.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/alertmanager-podDisruptionBudget.yaml
|
||||
- kube-prometheus/manifests/prometheus-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/prometheus-service.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-clusterRoleServerResources.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/prometheus-roleBindingConfig.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-daemonset.yaml
|
||||
- kube-prometheus/manifests/prometheus-roleBindingSpecificNamespaces.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-roleBindingAuthReader.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-clusterRoleBindingDelegator.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-serviceAccount.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-deployment.yaml
|
||||
- kube-prometheus/manifests/alertmanager-prometheusRule.yaml
|
||||
- kube-prometheus/manifests/prometheus-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-clusterRole.yaml
|
||||
- kube-prometheus/manifests/grafana-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-clusterRole.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-service.yaml
|
||||
- kube-prometheus/manifests/prometheus-podDisruptionBudget.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-service.yaml
|
||||
- kube-prometheus/manifests/nodeExporter-serviceMonitor.yaml
|
||||
- kube-prometheus/manifests/blackboxExporter-clusterRoleBinding.yaml
|
||||
- kube-prometheus/manifests/alertmanager-secret.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-apiService.yaml
|
||||
- kube-prometheus/manifests/prometheusOperator-clusterRole.yaml
|
||||
- kube-prometheus/manifests/grafana-config.yaml
|
||||
- kube-prometheus/manifests/prometheusAdapter-podDisruptionBudget.yaml
|
||||
- kube-prometheus/manifests/kubeStateMetrics-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
|
||||
@@ -0,0 +1,3 @@
|
||||
resources:
|
||||
- rook/deploy/examples/cluster.yaml
|
||||
- rook/deploy/examples/csi/rbd/storageclass.yaml
|
||||
@@ -0,0 +1,8 @@
|
||||
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
|
||||
@@ -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
|
||||
@@ -18,19 +18,20 @@ LOAD_BALANCER_IP=${LOAD_BALANCER_IP:-""}
|
||||
LOAD_BALANCER_PORT="${LOAD_BALANCER_PORT:-6444}"
|
||||
|
||||
# versions
|
||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.10}"
|
||||
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.6.4}"
|
||||
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-960b3243b9a7faccdfe7b3c09097105e68030ea7}"
|
||||
CANAL_VER="${CLRK8S_CANAL_VER:-v3.24}"
|
||||
CILIUM_VER="${CLRK8S_CILIUM_VER:-v1.9.13}"
|
||||
FLANNEL_VER="${CLRK8S_FLANNEL_VER:-v0.16.3}"
|
||||
CILIUM_VAL_OVERRIDE=""
|
||||
K8S_VER="${CLRK8S_K8S_VER:-}"
|
||||
KATA_VER="${CLRK8S_KATA_VER:-1.9.1-kernel-config}"
|
||||
ROOK_VER="${CLRK8S_ROOK_VER:-v1.2.6}"
|
||||
METRICS_VER="${CLRK8S_METRICS_VER:-v0.3.6}"
|
||||
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.0.0-beta2}"
|
||||
INGRES_VER="${CLRK8S_INGRES_VER:-nginx-0.26.1}"
|
||||
EFK_VER="${CLRK8S_EFK_VER:-v1.15.1}"
|
||||
KATA_VER="${CLRK8S_KATA_VER:-2.4.0}"
|
||||
ROOK_VER="${CLRK8S_ROOK_VER:-v1.8.10}"
|
||||
METRICS_VER="${CLRK8S_METRICS_VER:-v0.6.1}"
|
||||
DASHBOARD_VER="${CLRK8S_DASHBOARD_VER:-v2.6.1}"
|
||||
INGRES_VER="${CLRK8S_INGRES_VER:-controller-v1.3.0}"
|
||||
EFK_VER="${CLRK8S_EFK_VER:-193692c92eb4667b8f4fb7d4cdf0462e229b5f13}"
|
||||
METALLB_VER="${CLRK8S_METALLB_VER:-v0.8.3}"
|
||||
NPD_VER="${CLRK8S_NPD_VER:-v0.6.6}"
|
||||
PROMETHEUS_VER="${CLRK8S_PROMETHEUS_VER:-f458e85e5d7675f7bc253072e1b4c8892b51af0f}"
|
||||
PROMETHEUS_VER="${CLRK8S_PROMETHEUS_VER:-v0.10.0}"
|
||||
CNI=${CLRK8S_CNI:-"canal"}
|
||||
if [[ -z "${RUNNER+x}" ]]; then RUNNER="${CLRK8S_RUNNER:-"crio"}"; fi
|
||||
|
||||
@@ -114,20 +115,30 @@ function cluster_init() {
|
||||
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
|
||||
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"
|
||||
fi
|
||||
}
|
||||
|
||||
function kata() {
|
||||
KATA_VER=${1:-$KATA_VER}
|
||||
KATA_URL="https://github.com/kata-containers/packaging.git"
|
||||
KATA_URL="https://github.com/kata-containers/kata-containers.git"
|
||||
KATA_DIR="8-kata"
|
||||
get_repo "${KATA_URL}" "${KATA_DIR}/overlays/${KATA_VER}"
|
||||
set_repo_version "${KATA_VER}" "${KATA_DIR}/overlays/${KATA_VER}/packaging"
|
||||
kubectl apply -k "${KATA_DIR}/overlays/${KATA_VER}"
|
||||
set_repo_version "${KATA_VER}" "${KATA_DIR}/overlays/${KATA_VER}/kata-containers"
|
||||
kubectl apply -f "${KATA_DIR}/overlays/${KATA_VER}/kata-containers/tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml"
|
||||
kubectl apply -f "${KATA_DIR}/overlays/${KATA_VER}/kata-containers/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml"
|
||||
kubectl apply -f "${KATA_DIR}/overlays/${KATA_VER}/kata-containers/tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml"
|
||||
|
||||
}
|
||||
|
||||
@@ -136,7 +147,7 @@ function cni() {
|
||||
canal)
|
||||
# note version is not semver
|
||||
CANAL_VER=${1:-$CANAL_VER}
|
||||
CANAL_URL="https://docs.projectcalico.org/${CANAL_VER}/manifests"
|
||||
CANAL_URL="https://projectcalico.docs.tigera.io/archive/${CANAL_VER}/manifests"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
CANAL_URL="https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/canal"
|
||||
fi
|
||||
@@ -144,7 +155,7 @@ function cni() {
|
||||
|
||||
# canal manifests are not kept in repo but in docs site so use curl
|
||||
mkdir -p "${CANAL_DIR}/overlays/${CANAL_VER}/canal"
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml"
|
||||
curl -L -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/canal.yaml" "$CANAL_URL/canal.yaml"
|
||||
if [[ "$CANAL_VER" == "v3.3" ]]; then
|
||||
curl -o "${CANAL_DIR}/overlays/${CANAL_VER}/canal/rbac.yaml" "$CANAL_URL/rbac.yaml"
|
||||
fi
|
||||
@@ -153,7 +164,7 @@ function cni() {
|
||||
;;
|
||||
flannel)
|
||||
FLANNEL_VER=${1:-$FLANNEL_VER}
|
||||
FLANNEL_URL="https://github.com/coreos/flannel"
|
||||
FLANNEL_URL="https://github.com/flannel-io/flannel"
|
||||
FLANNEL_DIR="0-flannel"
|
||||
|
||||
get_repo "${FLANNEL_URL}" "${FLANNEL_DIR}/overlays/${FLANNEL_VER}"
|
||||
@@ -161,13 +172,17 @@ function cni() {
|
||||
kubectl apply -k "${FLANNEL_DIR}/overlays/${FLANNEL_VER}"
|
||||
;;
|
||||
cilium)
|
||||
local podsubnet=$(grep -Po 'podSubnet:\ \K[^*]*' ${SCRIPT_DIR}/kubeadm.yaml)
|
||||
CILIUM_VER=${1:-$CILIUM_VER}
|
||||
CILIUM_URL="https://github.com/cilium/cilium.git"
|
||||
CILIUM_DIR="0-cilium"
|
||||
|
||||
get_repo "${CILIUM_URL}" "${CILIUM_DIR}/overlays/${CILIUM_VER}"
|
||||
set_repo_version "${CILIUM_VER}" "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/"
|
||||
helm template "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/install/kubernetes/cilium" --namespace kube-system --set global.containerRuntime.integration="$RUNNER" | kubectl apply -f -
|
||||
if [ -f "${CILIUM_DIR}/overlays/${CILIUM_VER}/values.yaml" ]; then
|
||||
CILIUM_VAL_OVERRIDE="--values ${CILIUM_DIR}/overlays/${CILIUM_VER}/values.yaml"
|
||||
fi
|
||||
helm template "${CILIUM_DIR}/overlays/${CILIUM_VER}/cilium/install/kubernetes/cilium" --namespace kube-system --set containerRuntime.integration="$RUNNER" --set hubble.enabled=false --set ipam.operator.clusterPoolIPv4PodCIDR="${podsubnet}" | kubectl apply -f -
|
||||
;;
|
||||
*)
|
||||
echo"Unknown cni $CNI"
|
||||
@@ -178,21 +193,19 @@ function cni() {
|
||||
|
||||
function metrics() {
|
||||
METRICS_VER="${1:-$METRICS_VER}"
|
||||
METRICS_URL="https://github.com/kubernetes-sigs/metrics-server.git"
|
||||
METRICS_URL="https://github.com/kubernetes-sigs/metrics-server/releases/download/${METRICS_VER}/components.yaml"
|
||||
METRICS_DIR="1-core-metrics"
|
||||
get_repo "${METRICS_URL}" "${METRICS_DIR}/overlays/${METRICS_VER}"
|
||||
set_repo_version "${METRICS_VER}" "${METRICS_DIR}/overlays/${METRICS_VER}/metrics-server"
|
||||
kubectl apply -k "${METRICS_DIR}/overlays/${METRICS_VER}"
|
||||
|
||||
curl -L ${METRICS_URL} --output - >${METRICS_DIR}/overlays/${METRICS_VER}/components.yaml
|
||||
kubectl apply -k "${METRICS_DIR}/overlays/${METRICS_VER}/"
|
||||
|
||||
}
|
||||
function wait_on_pvc() {
|
||||
# create and destroy pvc until successful
|
||||
while [[ $(kubectl get pvc test-pv-claim --no-headers | grep Bound -c) -ne 1 ]]; do
|
||||
sleep 30
|
||||
kubectl delete pvc test-pv-claim
|
||||
create_pvc
|
||||
sleep 10
|
||||
done
|
||||
kubectl delete pvc test-pv-claim
|
||||
}
|
||||
function create_pvc() {
|
||||
kubectl apply -f - <<HERE
|
||||
@@ -217,9 +230,19 @@ function storage() {
|
||||
ROOK_URL="https://github.com/rook/rook.git"
|
||||
ROOK_DIR=7-rook
|
||||
|
||||
# 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
|
||||
mode="standalone"
|
||||
fi
|
||||
|
||||
# get and apply rook
|
||||
get_repo "${ROOK_URL}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}"
|
||||
set_repo_version "${ROOK_VER}" "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook"
|
||||
kubectl apply -f ${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook/deploy/examples/crds.yaml -f ${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook/deploy/examples/common.yaml -f ${ROOK_DIR}/overlays/${ROOK_VER}/${mode}/rook/deploy/examples/operator.yaml
|
||||
while [[ $(kubectl get po -n rook-ceph --field-selector=status.phase=Running | grep -e 'operator' -c) -lt 1 ]]; do
|
||||
echo "Waiting on operator"
|
||||
sleep 10
|
||||
done
|
||||
kubectl apply -k "${ROOK_DIR}/overlays/${ROOK_VER}/${mode}"
|
||||
# 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
|
||||
@@ -241,13 +264,15 @@ function monitoring() {
|
||||
PROMETHEUS_DIR="4-kube-prometheus"
|
||||
get_repo "${PROMETHEUS_URL}" "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}"
|
||||
set_repo_version "${PROMETHEUS_VER}" "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus"
|
||||
kubectl apply -k "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}"
|
||||
kubectl apply --server-side -f "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/kube-prometheus/manifests/setup/"
|
||||
|
||||
while [[ $(kubectl get crd alertmanagers.monitoring.coreos.com prometheuses.monitoring.coreos.com prometheusrules.monitoring.coreos.com servicemonitors.monitoring.coreos.com >/dev/null 2>&1) || $? -ne 0 ]]; do
|
||||
echo "Waiting for Prometheus CRDs"
|
||||
sleep 2
|
||||
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"
|
||||
sleep 10
|
||||
done
|
||||
|
||||
kubectl apply -k "${PROMETHEUS_DIR}/overlays/${PROMETHEUS_VER}/"
|
||||
|
||||
#Expose the dashboards
|
||||
#kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090 &
|
||||
#kubectl --namespace monitoring port-forward svc/grafana 3000 &
|
||||
@@ -261,6 +286,8 @@ function dashboard() {
|
||||
get_repo "${DASHBOARD_URL}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}"
|
||||
set_repo_version "${DASHBOARD_VER}" "${DASHBOARD_DIR}/overlays/${DASHBOARD_VER}/dashboard"
|
||||
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() {
|
||||
@@ -274,10 +301,10 @@ function ingres() {
|
||||
|
||||
function efk() {
|
||||
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"
|
||||
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}"
|
||||
|
||||
}
|
||||
@@ -338,7 +365,7 @@ function minimal() {
|
||||
|
||||
function all() {
|
||||
minimal
|
||||
storage
|
||||
storage
|
||||
monitoring
|
||||
miscellaneous
|
||||
}
|
||||
@@ -377,6 +404,11 @@ command_handlers[monitoring]=monitoring
|
||||
command_handlers[metallb]=metallb
|
||||
command_handlers[npd]=npd
|
||||
command_handlers[nfd]=nfd
|
||||
command_handlers[kata]=kata
|
||||
command_handlers[metrics]=metrics
|
||||
command_handlers[dashboard]=dashboard
|
||||
command_handlers[efk]=efk
|
||||
command_handlers[ingres]=ingres
|
||||
|
||||
declare -A command_help
|
||||
command_help[init]="Only inits a cluster using kubeadm"
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
apiVersion: kubeadm.k8s.io/v1beta2
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: InitConfiguration
|
||||
---
|
||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||
kind: KubeletConfiguration
|
||||
cgroupDriver: systemd
|
||||
# Allowing for CPU pinning and isolation in case of guaranteed QoS class
|
||||
cpuManagerPolicy: static
|
||||
systemReserved:
|
||||
cpu: 500m
|
||||
memory: 256M
|
||||
@@ -13,7 +11,7 @@ kubeReserved:
|
||||
cpu: 500m
|
||||
memory: 256M
|
||||
---
|
||||
apiVersion: kubeadm.k8s.io/v1beta2
|
||||
apiVersion: kubeadm.k8s.io/v1beta3
|
||||
kind: ClusterConfiguration
|
||||
networking:
|
||||
dnsDomain: cluster.local
|
||||
|
||||
Reference in New Issue
Block a user