Skip to content

Commit 7544441

Browse files
committed
Merge branch 'feature/k8sVersionUpgrade' into 'main'
Kubernetesversion Upgrade to 1.27 See merge request observability-bd-projects/one-observability-demo!128
2 parents cf0fd92 + a0df2f8 commit 7544441

File tree

9 files changed

+25
-36
lines changed

9 files changed

+25
-36
lines changed

PetAdoptions/cdk/pet_stack/lib/services.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { CfnJson, RemovalPolicy, Fn, Duration, Stack, StackProps, CfnOutput } fr
3131
import { readFileSync } from 'fs';
3232
import 'ts-replace-all'
3333
import { TreatMissingData, ComparisonOperator } from 'aws-cdk-lib/aws-cloudwatch';
34+
import { KubectlLayer } from 'aws-cdk-lib/lambda-layer-kubectl';
3435

3536
export class Services extends Stack {
3637
constructor(scope: Construct, id: string, props?: StackProps) {
@@ -109,7 +110,8 @@ export class Services extends Stack {
109110
}
110111
// The VPC where all the microservices will be deployed into
111112
const theVPC = new ec2.Vpc(this, 'Microservices', {
112-
cidr: cidrRange,
113+
ipAddresses: ec2.IpAddresses.cidr(cidrRange),
114+
// cidr: cidrRange,
113115
natGateways: 1,
114116
maxAzs: 2
115117
});
@@ -333,7 +335,8 @@ export class Services extends Stack {
333335
vpc: theVPC,
334336
defaultCapacity: 2,
335337
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
336-
version: KubernetesVersion.V1_23
338+
version: KubernetesVersion.of('1.27'),
339+
kubectlLayer: new KubectlLayer(this, 'kubectl')
337340
});
338341

339342
const clusterSG = ec2.SecurityGroup.fromSecurityGroupId(this,'ClusterSG',cluster.clusterSecurityGroupId);

PetAdoptions/cdk/pet_stack/lib/services/stepfn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class PetAdoptionsStepFn extends Construct {
5959

6060

6161
this.stepFn = new sfn.StateMachine(this, 'StateMachine', {
62-
definition,
62+
definitionBody: sfn.DefinitionBody.fromChainable(definition),
6363
tracingEnabled: true,
6464
timeout: Duration.minutes(5)
6565
});

PetAdoptions/cdk/pet_stack/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
},
1414
"devDependencies": {
1515
"@aws-cdk/assert": "2.68.0",
16-
"@types/jest": "^29.5.2",
17-
"@types/node": "^20.2.5",
18-
"aws-cdk": "2.82.0",
19-
"constructs": "^10.2.43",
20-
"ts-jest": "^29.1.0",
16+
"@types/jest": "^29.5.4",
17+
"@types/node": "^20.5.7",
18+
"aws-cdk": "2.93.0",
19+
"constructs": "^10.2.69",
20+
"ts-jest": "^29.1.1",
2121
"ts-node": "^10.9.1",
2222
"ts-replace-all": "1.0.0",
23-
"typescript": "^5.1.3",
24-
"cdk-nag": "^2.27.28"
23+
"typescript": "^5.2.2",
24+
"cdk-nag": "^2.27.114"
2525
},
2626
"dependencies": {
27-
"@aws-cdk/aws-lambda-python-alpha": "^2.82.0-alpha.0",
27+
"@aws-cdk/aws-lambda-python-alpha": "^2.93.0-alpha.0",
2828
"@types/js-yaml": "4.0.5",
29-
"aws-cdk-lib": "^2.82.0",
30-
"cdk-ecr-deployment": "^2.5.6",
31-
"jest": "^29.5.0",
29+
"aws-cdk-lib": "^2.93.0",
30+
"cdk-ecr-deployment": "^2.5.30",
31+
"jest": "^29.6.4",
3232
"js-yaml": "^4.1.0",
3333
"source-map-support": "^0.5.21"
3434
}

PetAdoptions/cdk/pet_stack/resources/destroy_stack.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ if [ -z $STACK_NAME_APP ]; then STACK_NAME_APP="Applications"; fi
2828
aws eks update-kubeconfig --name PetSite
2929
kubectl delete -f https://raw.githubusercontent.com/aws-samples/one-observability-demo/main/PetAdoptions/cdk/pet_stack/resources/load_balancer/crds.yaml
3030

31+
#Deleting keycloak
32+
kubectl delete namespace keycloak --force
33+
3134
# Get rid of all resources (Application first, then cluster or it will fail)
3235
cdk destroy $STACK_NAME_APP --force
3336
cdk destroy $STACK_NAME --force

PetAdoptions/cdk/pet_stack/resources/setup-ssm-agent.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,6 @@ subjects:
3434
name: ssm-agent-installer
3535
namespace: node-configuration-daemonset
3636
---
37-
apiVersion: policy/v1beta1
38-
kind: PodSecurityPolicy
39-
metadata:
40-
name: ssm-agent-installer
41-
spec:
42-
privileged: true
43-
hostPID: true
44-
seLinux:
45-
rule: RunAsAny
46-
supplementalGroups:
47-
rule: RunAsAny
48-
runAsUser:
49-
rule: RunAsAny
50-
fsGroup:
51-
rule: RunAsAny
52-
---
5337
apiVersion: v1
5438
kind: ConfigMap
5539
metadata:

PetAdoptions/envsetup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ git clone https://github.com/aws-samples/one-observability-demo
7373

7474
# Fetch usage tracker file
7575
# aws s3api get-object --bucket one-observability-workshop-tracker --key lab_user.txt lab_user.txt --region us-east-1
76+
77+
# Install helm
78+
curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

PetAdoptions/payforadoption-go/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM golang:1.20 as builder
22
WORKDIR /go/src/app
33
COPY . .
4+
ENV GOPROXY=https://goproxy.io,direct
45
RUN go get .
56
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
67

PetAdoptions/petlistadoptions-go/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM golang:1.20 as builder
22
WORKDIR /go/src/app
33
COPY . .
4+
ENV GOPROXY=https://goproxy.io,direct
45
RUN go get .
56
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
67

package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)