diff --git a/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/kustomization.yaml b/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/kustomization.yaml new file mode 100644 index 0000000..9a19bea --- /dev/null +++ b/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - components.yaml +patchesJson6902: + - target: + version: v1 + kind: Deployment + name: metrics-server + path: patch_metricstls.yaml diff --git a/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/patch_metricstls.yaml b/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/patch_metricstls.yaml new file mode 100644 index 0000000..5b37db3 --- /dev/null +++ b/clr-k8s-examples/1-core-metrics/overlays/v0.6.1/patch_metricstls.yaml @@ -0,0 +1,3 @@ +- op: add + path: "/spec/template/spec/containers/0/args/-" + value: --kubelet-insecure-tls diff --git a/clr-k8s-examples/4-kube-prometheus/overlays/v0.10.0/kustomization.yaml b/clr-k8s-examples/4-kube-prometheus/overlays/v0.10.0/kustomization.yaml new file mode 100644 index 0000000..2e599f7 --- /dev/null +++ b/clr-k8s-examples/4-kube-prometheus/overlays/v0.10.0/kustomization.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 diff --git a/clr-k8s-examples/7-rook/overlays/v1.8.6/multinode/kustomization.yaml b/clr-k8s-examples/7-rook/overlays/v1.8.6/multinode/kustomization.yaml new file mode 100644 index 0000000..46c8c5a --- /dev/null +++ b/clr-k8s-examples/7-rook/overlays/v1.8.6/multinode/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - rook/deploy/examples/cluster.yaml + - rook/deploy/examples/csi/rbd/storageclass.yaml diff --git a/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/kustomization.yaml b/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/kustomization.yaml new file mode 100644 index 0000000..3b8b39e --- /dev/null +++ b/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/kustomization.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 diff --git a/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/patch_cephcluster.yaml b/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/patch_cephcluster.yaml new file mode 100644 index 0000000..a348a27 --- /dev/null +++ b/clr-k8s-examples/7-rook/overlays/v1.8.6/standalone/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 diff --git a/clr-k8s-examples/8-kata/overlays/2.3.3/.gitkeep b/clr-k8s-examples/8-kata/overlays/2.3.3/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/clr-k8s-examples/create_stack.sh b/clr-k8s-examples/create_stack.sh index 8fcf6f1..5547fcf 100755 --- a/clr-k8s-examples/create_stack.sh +++ b/clr-k8s-examples/create_stack.sh @@ -23,15 +23,15 @@ 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}" +KATA_VER="${CLRK8S_KATA_VER:-2.3.3}" +ROOK_VER="${CLRK8S_ROOK_VER:-v1.8.6}" +METRICS_VER="${CLRK8S_METRICS_VER:-v0.6.1}" 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}" 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 @@ -124,11 +124,13 @@ function cluster_init() { 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" } @@ -183,21 +185,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 - </dev/null 2>&1) || $? -ne 0 ]]; do - echo "Waiting for Prometheus CRDs" - sleep 2 + while ! $(kubectl get servicemonitors --all-namespaces) ; 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 & @@ -382,6 +393,8 @@ command_handlers[monitoring]=monitoring command_handlers[metallb]=metallb command_handlers[npd]=npd command_handlers[nfd]=nfd +command_handlers[kata]=kata +command_handlers[metrics]=metrics declare -A command_help command_help[init]="Only inits a cluster using kubeadm"