Skip to content
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

[dev.smoke-framework] smoke updates #1296

Merged
merged 1 commit into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions production/tanka/grafana-agent/smoke/crow/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ local volume = k.core.v1.volume;
local this = self,

_config+:: {
image: 'us.gcr.io/kubernetes-dev/grafana/agent-crow:main',
image: 'us.gcr.io/kubernetes-dev/grafana/agent-crow:dev.smoke-framework',
args: {},
pull_secret: '',
} + config,

container::
Expand All @@ -27,6 +28,7 @@ local volume = k.core.v1.volume;

deployment:
deployment.new(name, 1, [self.container]) +
deployment.mixin.metadata.withNamespace(namespace),
deployment.mixin.metadata.withNamespace(namespace) +
deployment.spec.template.spec.withImagePullSecrets({ name: this._config.pull_secret }),
},
}
37 changes: 0 additions & 37 deletions production/tanka/grafana-agent/smoke/internal/smoke.libsonnet

This file was deleted.

52 changes: 45 additions & 7 deletions production/tanka/grafana-agent/smoke/main.libsonnet
Original file line number Diff line number Diff line change
@@ -1,13 +1,51 @@
local smoke = import './internal/smoke.libsonnet';
local k = import 'ksonnet-util/kausal.libsonnet';
local policyRule = k.rbac.v1.policyRule;
local serviceAccount = k.core.v1.serviceAccount;
local container = k.core.v1.container;
local deployment = k.apps.v1.deployment;

{
_images:: {
agentsmoke: 'us.gcr.io/kubernetes-dev/grafana/agent-smoke:latest',
},
new(name='grafana-agent-smoke', namespace='default', config={}):: {
local k = (import 'ksonnet-util/kausal.libsonnet') { _config+:: { namespace: namespace } },

local this = self,

_images:: {
agentsmoke: 'us.gcr.io/kubernetes-dev/grafana/agent-smoke:dev.smoke-framework',
},

_config:: {
mutationFrequency: '5m',
chaosFrequency: '30m',
image: this._images.agentsmoke,
pull_secret: '',
} + config,

rbac:
k.util.rbac(name, [
policyRule.withApiGroups(['apps']) +
policyRule.withResources(['deployments/scale']) +
policyRule.withVerbs(['get', 'update']),
]) {
service_account+:
serviceAccount.mixin.metadata.withNamespace(namespace),
},

container::
container.new('agent-smoke', config.image) +
container.withCommand('/bin/grafana-agent-smoke') +
container.withArgsMixin(k.util.mapToFlags({
'log.level': 'debug',
'namespace': namespace,
'mutation-frequency': config.mutationFrequency,
'chaos-frequency': config.chaosFrequency,
})),

new(name='grafana-agent-smoke', namespace='grafana-agent-smoke', mutationFrequency='5m', chaosFrequency='30m', image=self._images.agentsmoke):: {
smoke:
smoke.newSmoke(name, namespace, mutationFrequency, chaosFrequency, image)
agentsmoke_deployment:
deployment.new(name, 1, [self.container]) +
deployment.mixin.metadata.withNamespace(namespace) +
deployment.mixin.spec.template.spec.withServiceAccount(name) +
deployment.spec.template.spec.withImagePullSecrets({ name: this._config.pull_secret }),
},

monitoring: (import './prometheus_monitoring.libsonnet'),
Expand Down
2 changes: 1 addition & 1 deletion tools/smoke/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BUILDPLATFORM
# Use custom Go version instead of one prepacked in seego
ENV GOLANG_VERSION 1.17.6
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2
ENV GOLANG_DOWNLOAD_SHA256 231654bbf2dab3d86c1619ce799e77b03d96f9b50770297c8f4dff8836fc8ca2
RUN rm -rf /usr/local/go \
&& curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
Expand Down