Skip to content

Commit 40f581d

Browse files
committed
Updated the versions and ALB naming
1 parent 46a5872 commit 40f581d

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

lib/alb_controller_iam_policy.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"elasticloadbalancing:DescribeTargetGroups",
3939
"elasticloadbalancing:DescribeTargetGroupAttributes",
4040
"elasticloadbalancing:DescribeTargetHealth",
41-
"elasticloadbalancing:DescribeTags"
41+
"elasticloadbalancing:DescribeTags",
42+
"elasticloadbalancing:DescribeListenerAttributes"
4243
],
4344
"Resource": "*"
4445
},

lib/posit-eks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class EksStack extends cdk.NestedStack {
5454
subnetIds: props.vpc.privateSubnets.map(subnet => subnet.subnetId),
5555
endpointPrivateAccess: true
5656
},
57-
version: '1.29', // eks.KubernetesVersion.V1_28.version
57+
version: '1.30',
5858
logging: {
5959
clusterLogging: {
6060
enabledTypes: [
@@ -82,7 +82,6 @@ export class EksStack extends cdk.NestedStack {
8282
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
8383
managedPolicies: [
8484
iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonEKSWorkerNodePolicy'),
85-
// needed at first, otherwise node group doesn't join cluster
8685
iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonEKS_CNI_Policy'),
8786
iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonEC2ContainerRegistryReadOnly'),
8887
iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore'),

scripts/cert-install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "./scripts/utils.sh"
44
# Define your domain
55
export_env_from_file "./.env"
66
if ! aws eks update-kubeconfig --name $EKS_CLUSTER_NAME; then exit; fi
7-
DOMAIN=$(kubectl get ingress traefik -n traefik -o json | jq -r ".status.loadBalancer.ingress[0].hostname")
7+
export LB_NAME="${EKS_CLUSTER_NAME}-alb"
88

99
# Check if ACM certificate exists for the domain
1010
certificate_arn=$(aws acm list-certificates --query "CertificateSummaryList[?DomainName=='$DOMAIN'].CertificateArn" --output text)
@@ -13,18 +13,18 @@ if [ -n "$certificate_arn" ]; then
1313
echo "Certificate already exists for $DOMAIN with ARN: $certificate_arn"
1414
else
1515
echo "Certificate doesn't exist for $DOMAIN. Generating one..."
16-
openssl genrsa -out "$DOMAIN.key" 2048
17-
openssl req -new -key "$DOMAIN.key" -out "$DOMAIN.csr" -subj "/CN=$DOMAIN"
18-
openssl x509 -req -days 365 -in "$DOMAIN.csr" -signkey "$DOMAIN.key" -out "$DOMAIN.crt"
19-
aws acm import-certificate --certificate fileb://"$DOMAIN.crt" --private-key fileb://"$DOMAIN.key"
16+
openssl genrsa -out "$LB_NAME.key" 2048
17+
openssl req -new -key "$LB_NAME.key" -out "$LB_NAME.csr" -subj "/CN=$DOMAIN"
18+
openssl x509 -req -days 365 -in "$LB_NAME.csr" -signkey "$LB_NAME.key" -out "$LB_NAME.crt"
19+
aws acm import-certificate --certificate fileb://"$LB_NAME.crt" --private-key fileb://"$LB_NAME.key"
2020

2121
rm "$DOMAIN.key" "$DOMAIN.csr" "$DOMAIN.crt"
2222
echo "Certificate has been generated and added to ACM for $DOMAIN"
2323
fi
2424

2525
#Get ALB from domain name
2626
certificate_arn=$(aws acm list-certificates --query "CertificateSummaryList[?DomainName=='$DOMAIN'].CertificateArn" --output text)
27-
alb=$(aws elbv2 describe-load-balancers --query "LoadBalancers[?DNSName=='$DOMAIN'].LoadBalancerArn" --output text)
27+
alb=$(aws elbv2 describe-load-balancers --names $LB_NAME --query 'LoadBalancers[0].LoadBalancerArn' --output text)
2828

2929
#Get data, copy HTTP Rule directly
3030
https_listener=$(aws elbv2 describe-listeners --load-balancer-arn $alb --query "Listeners[?Protocol=='HTTPS'].ListenerArn" --output text)

scripts/manifests/aws-lb-controller-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
annotations:
88
alb.ingress.kubernetes.io/backend-protocol: HTTP
99
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
10-
alb.ingress.kubernetes.io/load-balancer-name: posit-sce-alb
10+
alb.ingress.kubernetes.io/load-balancer-name: ${LB_NAME}
1111
alb.ingress.kubernetes.io/scheme: internet-facing
1212
alb.ingress.kubernetes.io/success-codes: 200-404
1313
alb.ingress.kubernetes.io/target-type: instance

scripts/manifests/posit-helm-workbench.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ config:
6565
# These settings apply to Jupyter Notebook and JupyterLab IDE sessions
6666
session-cull-minutes: 60
6767
session-shutdown-minutes: 5
68+
vscode.conf:
69+
enabled: 1
70+
session-timeout-kill-hours: 12
6871
profiles:
6972
launcher.kubernetes.profiles.conf:
7073
"*":
@@ -76,3 +79,8 @@ config:
7679
default-mem-mb: "1024"
7780
max-cpus: "12.0"
7881
max-mem-mb: "16384"
82+
prometheus:
83+
enabled: false
84+
legacy: false
85+
prometheusExporter:
86+
enabled: false

scripts/posit-install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ load_secrets() {
2727

2828
# Function to check the status of the load balancer
2929
check_load_balancer_status() {
30-
lb_status=$(aws elbv2 describe-load-balancers --names 'posit-sce-alb' --query 'LoadBalancers[0].State.Code' --output text)
30+
lb_status=$(aws elbv2 describe-load-balancers --names $LB_NAME --query 'LoadBalancers[0].State.Code' --output text)
3131

3232
# Check if the load balancer is active
3333
if [ "$lb_status" == "active" ]; then
@@ -78,6 +78,7 @@ NC="\e[0m"
7878
set_defaults
7979
export_env_from_file "./.env"
8080
RDS_PARAMS=$(load_secrets $POSTGRES_SECRET)
81+
export LB_NAME="${EKS_CLUSTER_NAME}-alb"
8182

8283
# 1.1 Configure EKS Cluster
8384
printf "${BLUE}------------------------------------------------------${NC} \n"
@@ -122,11 +123,12 @@ envsubst < scripts/manifests/aws-lb-controller-ingress.yaml | kubectl apply -f -
122123
sleep 5
123124
check_load_balancer_status
124125

125-
export LB=$(kubectl get ingress traefik -n traefik -o json | jq -r ".status.loadBalancer.ingress[0].hostname")
126+
export LB_URL=$(aws elbv2 describe-load-balancers --names $LB_NAME --query 'LoadBalancers[0].DNSName' --output text)
127+
printf "Loadbalancer DNS: ${LB_URL}"
126128
if $domain; then
127129
export DOMAIN=$domain
128130
else
129-
export DOMAIN=$LB
131+
export DOMAIN=$LB_URL
130132
fi
131133

132134
# 5. Setup POSIT PV's
@@ -165,7 +167,7 @@ printf "${BLUE}------------------------------------------------------${NC} \n"
165167
printf "${BLUE}Installing & configuring the Workbench helm chart (Max. 30 seconds) ${NC} \n"
166168
printf "${BLUE}------------------------------------------------------${NC} \n"
167169
kubectl config set-context --current --namespace=posit-workbench
168-
envsubst < ./scripts/manifests/posit-helm-workbench.yaml | helm upgrade --install rstudio-workbench-prod rstudio/rstudio-workbench \
170+
envsubst < ./scripts/manifests/posit-helm-workbench.yaml | helm upgrade --install rstudio-workbench-prod rstudio/rstudio-workbench --version 0.8.9 \
169171
--set license.key="${PWB_LICENSE}" \
170172
--set config.secret.'database\.conf'.password="${POSTGRES_PASSWORD}" \
171173
-f -

0 commit comments

Comments
 (0)