-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StormForge add-on #323
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
eks-anywhere-common/Addons/Partner/StormForge/external-secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: stormforge-external-secret | ||
namespace: stormforge | ||
spec: | ||
refreshInterval: 5m | ||
secretStoreRef: | ||
name: eksa-secret-store | ||
kind: ClusterSecretStore | ||
target: | ||
name: stormforge-auth-secret | ||
data: | ||
- secretKey: clientID | ||
remoteRef: | ||
key: stormforge-secrets | ||
property: clientID | ||
- secretKey: clientSecret | ||
remoteRef: | ||
key: stormforge-secrets | ||
property: clientSecret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: stormforge | ||
labels: | ||
aws.conformance.vendor: stormforge | ||
aws.conformance.vendor-solution: optimize-live | ||
aws.conformance.vendor-solution-version: 2.16.1 |
32 changes: 32 additions & 0 deletions
32
eks-anywhere-common/Addons/Partner/StormForge/stormforge-agent-release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: stormforge-agent-release | ||
namespace: stormforge | ||
spec: | ||
releaseName: stormforge-agent | ||
chart: | ||
spec: | ||
chart: stormforge-agent | ||
reconcileStrategy: ChartVersion | ||
sourceRef: | ||
kind: HelmRepository | ||
name: stormforge-charts | ||
namespace: flux-system | ||
version: 2.16.1 | ||
interval: 5m0s | ||
targetNamespace: stormforge | ||
valuesFrom: | ||
- kind: ConfigMap | ||
name: stormforge-clustername | ||
valuesKey: clusterName | ||
targetPath: clusterName | ||
- kind: Secret | ||
name: stormforge-auth-secret | ||
valuesKey: clientID | ||
targetPath: authorization.clientID | ||
- kind: Secret | ||
name: stormforge-auth-secret | ||
valuesKey: clientSecret | ||
targetPath: authorization.clientSecret |
19 changes: 19 additions & 0 deletions
19
eks-anywhere-common/Addons/Partner/StormForge/stormforge-applier-release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: stormforge-applier-release | ||
namespace: stormforge | ||
spec: | ||
releaseName: stormforge-applier | ||
chart: | ||
spec: | ||
chart: stormforge-applier | ||
reconcileStrategy: ChartVersion | ||
sourceRef: | ||
kind: HelmRepository | ||
name: stormforge-charts | ||
namespace: flux-system | ||
version: 2.6.0 | ||
interval: 5m0s | ||
targetNamespace: stormforge |
56 changes: 56 additions & 0 deletions
56
eks-anywhere-common/Addons/Partner/StormForge/stormforge-cluster-name.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: stormforge-configmaps-admin | ||
namespace: stormforge | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: stormforge-configmaps-admin | ||
namespace: stormforge | ||
rules: | ||
- apiGroups: [""] # "" indicates the core API group | ||
resources: ["configmaps"] | ||
verbs: ["*"] # full access | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: stormforge-configmaps-admin | ||
namespace: stormforge | ||
subjects: | ||
- kind: ServiceAccount | ||
name: stormforge-configmaps-admin | ||
namespace: stormforge | ||
roleRef: | ||
kind: Role | ||
name: stormforge-configmaps-admin | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: stormforge-cluster-name | ||
namespace: stormforge | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: stormforge-configmaps-admin | ||
containers: | ||
- name: generate-name | ||
image: bitnami/kubectl:1.31 | ||
env: | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
command: | ||
- '/bin/sh' | ||
- '-c' | ||
- | | ||
cm_name=stormforge-clustername | ||
cluster_name="eksa-test-$(LC_ALL=C tr -dc a-z0-9 </dev/urandom | head -c 7; echo)" | ||
kubectl create configmap "$cm_name" -n "$NAMESPACE" --from-literal clusterName="$cluster_name" |
10 changes: 10 additions & 0 deletions
10
eks-anywhere-common/Addons/Partner/StormForge/stormforge-source.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: stormforge-charts | ||
namespace: flux-system | ||
spec: | ||
type: "oci" | ||
interval: 5m0s | ||
url: oci://registry.stormforge.io/library |
64 changes: 64 additions & 0 deletions
64
eks-anywhere-common/Testers/StormForge/stormforge-test-job.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: stormforge-test-job | ||
namespace: stormforge | ||
spec: | ||
template: | ||
spec: | ||
activeDeadlineSeconds: 1800 | ||
restartPolicy: Never | ||
containers: | ||
- name: stormforge-test-job | ||
image: badouralix/curl-jq:alpine | ||
env: | ||
- name: CLI_VERSION | ||
value: "5.1.9" | ||
envFrom: | ||
- secretRef: | ||
name: stormforge-agent-auth | ||
- secretRef: | ||
name: stormforge-agent-env | ||
command: | ||
- '/bin/sh' | ||
- '-c' | ||
- | | ||
# Setup: Fetch the StormForge CLI tool | ||
while :; do | ||
[ "$(uname -sm)" = "Linux aarch64" ] && arch=arm64 || arch=amd64 | ||
curl -L "https://downloads.stormforge.io/stormforge-cli/v${CLI_VERSION}/stormforge_${CLI_VERSION}_linux_${arch}.tar.gz" | tar -xz | ||
if [ $? = 0 ]; then | ||
chmod a+x ./stormforge | ||
mv ./stormforge /usr/local/bin | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
|
||
# Tidy: delete any old and inactive eksa test clusters that may still be registered | ||
stormforge get clusters --state Inactive -o json \ | ||
| jq -r '.items[].name | select(. | test("^eksa-test-"))' \ | ||
| xargs --no-run-if-empty stormforge delete clusters | ||
|
||
# Validate: when the cluster name has been registered, is not Inactive, and | ||
# shows both products connected, then Optimize Live is working. | ||
while :; do | ||
echo "checking for stormforge-agent, stormforge-applier registration on $STORMFORGE_CLUSTER_NAME" | ||
if stormforge get cluster "$STORMFORGE_CLUSTER_NAME" -o json \ | ||
| jq -e 'all(.items[]; | ||
(.status.phase == "Created") | ||
and | ||
all(.stormforge.products | map(.name); | ||
any(index("stormforge-agent")) | ||
and | ||
any(index("stormforge-applier")) ))' | ||
then | ||
echo "successfully connected ${STORMFORGE_CLUSTER_NAME} to StormForge backend" | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
|
||
# Success! (failure is handled by spec.activeDeadlineSeconds) | ||
exit 0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace this with a CronJob which runs on schedule each day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjustment made.
It didn't look like there was a particular convention for what the schedule should be, so I just picked something (every 6 hours, at half-past). Let me know if there's a preferred schedule and I can use that instead.