Skip to content

Commit abdc0cd

Browse files
committed
Remove cortex namespace configuration option
1 parent 26ea4e8 commit abdc0cd

12 files changed

+32
-40
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ devstart:
2626

2727
kubectl:
2828
@source ./dev/config/cortex.sh && eksctl utils write-kubeconfig --name="$$CORTEX_CLUSTER" | grep -v "saved kubeconfig as" | grep -v "using region" || true
29-
@source ./dev/config/cortex.sh && kubectl config set-context --current --namespace="$$CORTEX_NAMESPACE" >/dev/null
29+
@source ./dev/config/cortex.sh && kubectl config set-context --current --namespace=cortex >/dev/null
3030

3131
cortex-up:
3232
@$(MAKE) registry-all
@@ -74,7 +74,7 @@ operator-update:
7474

7575
operator-stop:
7676
@$(MAKE) kubectl
77-
@source ./dev/config/cortex.sh && kubectl delete --namespace="$$CORTEX_NAMESPACE" --ignore-not-found=true deployment operator
77+
@source ./dev/config/cortex.sh && kubectl delete --namespace=cortex --ignore-not-found=true deployment operator
7878

7979
# Docker images
8080

cortex.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export CORTEX_CLUSTER="${CORTEX_CLUSTER:-cortex}"
108108
export CORTEX_NODE_TYPE="${CORTEX_NODE_TYPE:-m5.large}"
109109
export CORTEX_NODES_MIN="${CORTEX_NODES_MIN:-2}"
110110
export CORTEX_NODES_MAX="${CORTEX_NODES_MAX:-5}"
111-
export CORTEX_NAMESPACE="${CORTEX_NAMESPACE:-cortex}"
112111

113112
export CORTEX_IMAGE_MANAGER="${CORTEX_IMAGE_MANAGER:-cortexlabs/manager:$CORTEX_VERSION_BRANCH_STABLE}"
114113
export CORTEX_IMAGE_FLUENTD="${CORTEX_IMAGE_FLUENTD:-cortexlabs/fluentd:$CORTEX_VERSION_BRANCH_STABLE}"
@@ -252,7 +251,6 @@ function install_cortex() {
252251
-e CORTEX_AWS_SECRET_ACCESS_KEY=$CORTEX_AWS_SECRET_ACCESS_KEY \
253252
-e CORTEX_CLUSTER=$CORTEX_CLUSTER \
254253
-e CORTEX_REGION=$CORTEX_REGION \
255-
-e CORTEX_NAMESPACE=$CORTEX_NAMESPACE \
256254
-e CORTEX_NODE_TYPE=$CORTEX_NODE_TYPE \
257255
-e CORTEX_LOG_GROUP=$CORTEX_LOG_GROUP \
258256
-e CORTEX_BUCKET=$CORTEX_BUCKET \
@@ -283,7 +281,6 @@ function uninstall_operator() {
283281
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
284282
-e CORTEX_CLUSTER=$CORTEX_CLUSTER \
285283
-e CORTEX_REGION=$CORTEX_REGION \
286-
-e CORTEX_NAMESPACE=$CORTEX_NAMESPACE \
287284
$CORTEX_IMAGE_MANAGER
288285
}
289286

@@ -294,7 +291,6 @@ function info() {
294291
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
295292
-e CORTEX_CLUSTER=$CORTEX_CLUSTER \
296293
-e CORTEX_REGION=$CORTEX_REGION \
297-
-e CORTEX_NAMESPACE=$CORTEX_NAMESPACE \
298294
$CORTEX_IMAGE_MANAGER
299295
}
300296

dev/uninstall_cortex.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ eksctl utils write-kubeconfig --name=$CORTEX_CLUSTER --region=$CORTEX_REGION | g
2424
echo "Uninstalling Cortex ..."
2525

2626
kubectl delete --ignore-not-found=true namespace istio-system
27-
kubectl delete --ignore-not-found=true namespace $CORTEX_NAMESPACE
27+
kubectl delete --ignore-not-found=true namespace cortex
2828
kubectl delete --ignore-not-found=true -n kube-system deployment cluster-autoscaler
2929
kubectl delete --ignore-not-found=true apiservice v1beta1.metrics.k8s.io
3030
kubectl delete --ignore-not-found=true -n kube-system deployment metrics-server

docs/cluster/config.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ export CORTEX_NODES_MIN=2
3636
# Maximum number of nodes in the cluster
3737
export CORTEX_NODES_MAX=5
3838

39-
# The name of the Kubernetes namespace Cortex will use
40-
export CORTEX_NAMESPACE="cortex"
41-
4239
# Image paths
4340
export CORTEX_IMAGE_MANAGER="cortexlabs/manager:master"
4441
export CORTEX_IMAGE_FLUENTD="cortexlabs/fluentd:master"

docs/development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export CORTEX_CLUSTER="cortex"
5959
export CORTEX_NODE_TYPE="t3.medium"
6060
export CORTEX_NODES_MIN="2"
6161
export CORTEX_NODES_MAX="5"
62-
export CORTEX_NAMESPACE="cortex"
6362

6463
export CORTEX_IMAGE_MANAGER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/manager:latest"
6564
export CORTEX_IMAGE_FLUENTD="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/fluentd:latest"

manager/install_cortex.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ function setup_cloudwatch_logs() {
5050
}
5151

5252
function setup_configmap() {
53-
kubectl -n=$CORTEX_NAMESPACE create configmap 'cortex-config' \
53+
kubectl -n=cortex create configmap 'cortex-config' \
5454
--from-literal='LOG_GROUP'=$CORTEX_LOG_GROUP \
5555
--from-literal='BUCKET'=$CORTEX_BUCKET \
5656
--from-literal='REGION'=$CORTEX_REGION \
57-
--from-literal='NAMESPACE'=$CORTEX_NAMESPACE \
57+
--from-literal='NAMESPACE'=cortex \
5858
--from-literal='IMAGE_OPERATOR'=$CORTEX_IMAGE_OPERATOR \
5959
--from-literal='IMAGE_TF_SERVE'=$CORTEX_IMAGE_TF_SERVE \
6060
--from-literal='IMAGE_ONNX_SERVE'=$CORTEX_IMAGE_ONNX_SERVE \
@@ -67,7 +67,7 @@ function setup_configmap() {
6767
}
6868

6969
function setup_secrets() {
70-
kubectl -n=$CORTEX_NAMESPACE create secret generic 'aws-credentials' \
70+
kubectl -n=cortex create secret generic 'aws-credentials' \
7171
--from-literal='AWS_ACCESS_KEY_ID'=$CORTEX_AWS_ACCESS_KEY_ID \
7272
--from-literal='AWS_SECRET_ACCESS_KEY'=$CORTEX_AWS_SECRET_ACCESS_KEY \
7373
-o yaml --dry-run | kubectl apply -f - >/dev/null
@@ -114,11 +114,11 @@ function validate_cortex() {
114114
echo -n "."
115115
sleep 5
116116

117-
operator_pod_name=$(kubectl -n=$CORTEX_NAMESPACE get pods -o=name --sort-by=.metadata.creationTimestamp | grep "^pod/operator-" | tail -1)
117+
operator_pod_name=$(kubectl -n=cortex get pods -o=name --sort-by=.metadata.creationTimestamp | grep "^pod/operator-" | tail -1)
118118
if [ "$operator_pod_name" == "" ]; then
119119
operator_pod_ready_cycles=0
120120
else
121-
is_ready=$(kubectl -n=$CORTEX_NAMESPACE get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].ready}')
121+
is_ready=$(kubectl -n=cortex get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].ready}')
122122
if [ "$is_ready" == "true" ]; then
123123
((operator_pod_ready_cycles++))
124124
else
@@ -154,10 +154,10 @@ function validate_cortex() {
154154
fi
155155

156156
if [ "$operator_pod_ready_cycles" == "0" ] && [ "$operator_pod_name" != "" ]; then
157-
num_restart=$(kubectl -n=$CORTEX_NAMESPACE get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].restartCount}')
157+
num_restart=$(kubectl -n=cortex get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].restartCount}')
158158
if [[ $num_restart -ge 2 ]]; then
159159
echo -e "\n\nAn error occurred when starting the Cortex operator. View the logs with:"
160-
echo " kubectl logs $operator_pod_name --namespace=$CORTEX_NAMESPACE"
160+
echo " kubectl logs $operator_pod_name --namespace=cortex"
161161
exit 1
162162
fi
163163
continue

manager/manifests/apis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ apiVersion: networking.istio.io/v1alpha3
1616
kind: Gateway
1717
metadata:
1818
name: apis-gateway
19-
namespace: $CORTEX_NAMESPACE
19+
namespace: cortex
2020
spec:
2121
selector:
2222
istio: apis-ingressgateway

manager/manifests/fluentd.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ apiVersion: v1
1616
kind: ServiceAccount
1717
metadata:
1818
name: fluentd
19-
namespace: $CORTEX_NAMESPACE
19+
namespace: cortex
2020
labels:
2121
app: fluentd
2222
---
2323
apiVersion: rbac.authorization.k8s.io/v1beta1
2424
kind: ClusterRole
2525
metadata:
2626
name: fluentd
27-
namespace: $CORTEX_NAMESPACE
27+
namespace: cortex
2828
rules:
2929
- apiGroups: [""]
3030
resources:
@@ -37,11 +37,11 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
3737
kind: ClusterRoleBinding
3838
metadata:
3939
name: fluentd
40-
namespace: $CORTEX_NAMESPACE
40+
namespace: cortex
4141
subjects:
4242
- kind: ServiceAccount
4343
name: fluentd
44-
namespace: $CORTEX_NAMESPACE
44+
namespace: cortex
4545
roleRef:
4646
kind: ClusterRole
4747
name: fluentd
@@ -52,7 +52,7 @@ apiVersion: v1
5252
kind: ConfigMap
5353
metadata:
5454
name: fluentd
55-
namespace: $CORTEX_NAMESPACE
55+
namespace: cortex
5656
data:
5757
fluent.conf: |
5858
@include containers.conf
@@ -65,7 +65,7 @@ data:
6565
@type tail
6666
@id in_tail_container_logs
6767
@label @containers
68-
path /var/log/containers/**_${CORTEX_NAMESPACE}_**.log
68+
path /var/log/containers/**_cortex_**.log
6969
pos_file /var/log/fluentd-containers.log.pos
7070
tag *
7171
read_from_head true
@@ -113,7 +113,7 @@ apiVersion: extensions/v1beta1
113113
kind: DaemonSet
114114
metadata:
115115
name: fluentd
116-
namespace: $CORTEX_NAMESPACE
116+
namespace: cortex
117117
spec:
118118
template:
119119
metadata:

manager/manifests/namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
apiVersion: v1
1616
kind: Namespace
1717
metadata:
18-
name: $CORTEX_NAMESPACE
18+
name: cortex

manager/manifests/operator.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ apiVersion: v1
1616
kind: ServiceAccount
1717
metadata:
1818
name: operator
19-
namespace: $CORTEX_NAMESPACE
19+
namespace: cortex
2020

2121
---
2222

2323
apiVersion: rbac.authorization.k8s.io/v1
2424
kind: ClusterRoleBinding
2525
metadata:
2626
name: operator
27-
namespace: $CORTEX_NAMESPACE
27+
namespace: cortex
2828
subjects:
2929
- kind: ServiceAccount
3030
name: operator
31-
namespace: $CORTEX_NAMESPACE
31+
namespace: cortex
3232
roleRef:
3333
kind: ClusterRole
3434
name: cluster-admin
@@ -40,7 +40,7 @@ apiVersion: apps/v1
4040
kind: Deployment
4141
metadata:
4242
name: operator
43-
namespace: $CORTEX_NAMESPACE
43+
namespace: cortex
4444
labels:
4545
workloadType: operator
4646
workloadID: operator
@@ -93,7 +93,7 @@ spec:
9393
apiVersion: v1
9494
kind: Service
9595
metadata:
96-
namespace: $CORTEX_NAMESPACE
96+
namespace: cortex
9797
name: operator
9898
labels:
9999
workloadType: operator
@@ -112,7 +112,7 @@ apiVersion: networking.istio.io/v1alpha3
112112
kind: Gateway
113113
metadata:
114114
name: operator-gateway
115-
namespace: $CORTEX_NAMESPACE
115+
namespace: cortex
116116
spec:
117117
selector:
118118
istio: operator-ingressgateway
@@ -140,7 +140,7 @@ apiVersion: networking.istio.io/v1alpha3
140140
kind: VirtualService
141141
metadata:
142142
name: operator
143-
namespace: $CORTEX_NAMESPACE
143+
namespace: cortex
144144
spec:
145145
hosts:
146146
- "*"

manager/manifests/statsd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ data:
3939
kind: ConfigMap
4040
metadata:
4141
name: cwagentstatsdconfig
42-
namespace: $CORTEX_NAMESPACE
42+
namespace: cortex
4343
---
4444
apiVersion: apps/v1
4545
kind: DaemonSet
4646
metadata:
4747
name: cloudwatch-agent-statsd
48-
namespace: $CORTEX_NAMESPACE
48+
namespace: cortex
4949
spec:
5050
selector:
5151
matchLabels:

manager/uninstall_operator.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ eksctl utils write-kubeconfig --name=$CORTEX_CLUSTER --region=$CORTEX_REGION | g
2222

2323
echo "Uninstalling the Cortex operator ..."
2424

25-
kubectl -n=$CORTEX_NAMESPACE delete --ignore-not-found=true deployment operator >/dev/null 2>&1
25+
kubectl -n=cortex delete --ignore-not-found=true deployment operator >/dev/null 2>&1
2626

2727
# Pods in DaemonSets cannot be modified
28-
kubectl -n=$CORTEX_NAMESPACE delete --ignore-not-found=true daemonset cloudwatch-agent-statsd >/dev/null 2>&1
29-
kubectl -n=$CORTEX_NAMESPACE delete --ignore-not-found=true daemonset fluentd >/dev/null 2>&1
30-
kubectl -n=$CORTEX_NAMESPACE delete --ignore-not-found=true daemonset nvidia-device-plugin-daemonset >/dev/null 2>&1
28+
kubectl -n=cortex delete --ignore-not-found=true daemonset cloudwatch-agent-statsd >/dev/null 2>&1
29+
kubectl -n=cortex delete --ignore-not-found=true daemonset fluentd >/dev/null 2>&1
30+
kubectl -n=cortex delete --ignore-not-found=true daemonset nvidia-device-plugin-daemonset >/dev/null 2>&1
3131

3232
echo "✓ Uninstalled the Cortex operator"

0 commit comments

Comments
 (0)