Skip to content

Commit

Permalink
Merge branch 'main' into feature/expose-services
Browse files Browse the repository at this point in the history
  • Loading branch information
mablanco authored Nov 10, 2023
2 parents 968f387 + 1eeb8d6 commit 29b534e
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ jobs:
run: |
helm template manifests/bootstrap --set revision=${{ github.ref_name }} > app-of-apps.yaml
./scripts/upload-assets.sh ${{ github.repository }} app-of-apps.yaml ${{ github.ref }}
yq '.argocd-source' ./addons/argocd/values.yaml > argocd-helm-values.yaml
./scripts/upload-assets.sh ${{ github.repository }} argocd-helm-values.yaml ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
12 changes: 6 additions & 6 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
argocd 2.8.4
argocd 2.9.0
eksctl 0.151.0
awscli 2.13.22
golang 1.21.1
golangci-lint 1.54.2
awscli 2.13.33
golang 1.21.4
golangci-lint 1.55.2
jq 1.6
helm 3.13.0
helm 3.13.2
kind 0.17.0
kubectl 1.27.4
pre-commit 3.4.0
pre-commit 3.5.0
tilt 0.33.3
gcloud 445.0.0
initium 0.5.0
2 changes: 1 addition & 1 deletion addons/grafana/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.0.1 # x-release-please-version
dependencies:
- name: grafana
alias: grafana-source
version: 6.60.1
version: 7.0.3
repository: https://grafana.github.io/helm-charts
condition: grafana-source.enabled
2 changes: 1 addition & 1 deletion addons/istio/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.1.0 # x-release-please-version
dependencies:
- name: base
alias: istio-base-source
version: 1.19.1
version: 1.19.3
repository: https://istio-release.storage.googleapis.com/charts
condition: istio-source.enabled
2 changes: 1 addition & 1 deletion addons/istio/ingressgateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.0.1 # x-release-please-version
dependencies:
- name: gateway
alias: istio-gateway-source
version: 1.19.1
version: 1.19.3
repository: https://istio-release.storage.googleapis.com/charts
condition: istio-source.enabled
2 changes: 1 addition & 1 deletion addons/istio/istiod/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.1.0 # x-release-please-version
dependencies:
- name: istiod
alias: istiod-source
version: 1.19.1
version: 1.19.3
repository: https://istio-release.storage.googleapis.com/charts
condition: istio-source.enabled
2 changes: 1 addition & 1 deletion addons/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.1.0 # x-release-please-version
dependencies:
- name: kube-prometheus-stack
alias: kube-prometheus-stack-source
version: 51.2.0
version: 52.1.0
repository: https://prometheus-community.github.io/helm-charts
condition: kube-prometheus-stack-source.enabled
2 changes: 1 addition & 1 deletion addons/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.0.1 # x-release-please-version
dependencies:
- name: loki
alias: loki-source
version: 5.23.1
version: 5.36.3
repository: https://grafana.github.io/helm-charts
condition: loki-source.enabled
2 changes: 1 addition & 1 deletion addons/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ version: v0.0.1 # x-release-please-version
dependencies:
- name: opentelemetry-collector
alias: otlp-collector-source
version: 0.69.2
version: 0.73.1
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
condition: otlp-collector-source.enabled
7 changes: 7 additions & 0 deletions examples/sample-app/sample-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ metadata:
name: sample-app
spec:
template:
metadata:
annotations:
# For testing purposes set request-per-second to 1 to force scaling
autoscaling.knative.dev/target: "1"
autoscaling.knative.dev/metric: "rps"
labels:
service: "ksample"
spec:
containers:
- image: nginx:stable
Expand Down
69 changes: 57 additions & 12 deletions examples/sample-app/sample_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package test
import (
"fmt"
"os"
"strings"
"testing"
"time"

_ "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/gruntwork-io/terratest/modules/k8s"

Expand All @@ -30,17 +32,60 @@ func TestExampleApp(t *testing.T) {
k8s.KubectlApply(t, kubectlOptions, "sample-app.yaml")

// =============================================================
http_helper.HTTPDoWithRetry(
t,
"GET",
fmt.Sprintf("http://%s", os.Getenv("INITIUM_LB_ENDPOINT")),
[]byte("Hello world from initium-platform!"),
map[string]string{"Host": "sample-app.default.example.com"},
200,
30,
3*time.Second,
nil,
)

numRequests := 5

for i := 0; i < numRequests; i++ {

http_helper.HTTPDoWithRetry(
t,
"GET",
fmt.Sprintf("http://%s", os.Getenv("INITIUM_LB_ENDPOINT")),
[]byte("Hello world from initium-platform!"),
map[string]string{"Host": "sample-app.default.example.com"},
200,
30,
3*time.Second,
nil,
)
}

sampleAppLabel := "ksample"
prefix := "sample-app"

//Wait for the pods to be created
time.Sleep(5 * time.Second)

podOptions := metav1.ListOptions{
LabelSelector: fmt.Sprintf("service=%s", sampleAppLabel),
}

pods := k8s.ListPods(t, kubectlOptions, podOptions)

assert.NotNil(t, pods)
// Validate knative scale-out process was effective
assert.Greater(t, len(pods), 1)

// Wait for knative to scale-in
time.Sleep(70 * time.Second)

replicaSets, err := k8s.RunKubectlAndGetOutputE(t, kubectlOptions, "get", "rs")
if err != nil {
t.Fatal(err)
}

replicaSetNames := strings.Fields(replicaSets)

var replicaSet string
for _, rs := range replicaSetNames {
if strings.HasPrefix(rs, prefix) {
replicaSet = rs
}
}

rs := k8s.GetReplicaSet(t, kubectlOptions, replicaSet)
// Validate knative scale-in process was effective
assert.Equal(t, int(rs.Status.Replicas), 0)

// =============================================================
k8s.KubectlDelete(t, kubectlOptions, "sample-app.yaml")
Expand Down
2 changes: 1 addition & 1 deletion utils/metallb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ version: v0.4.0 # x-release-please-version
dependencies:
- name: metallb
alias: metallb-source
version: 0.13.11
version: 0.13.12
repository: https://metallb.github.io/metallb

0 comments on commit 29b534e

Please sign in to comment.