-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for testing argo rollouts, add example manifests for argo ro…
…llouts
- Loading branch information
1 parent
df873ff
commit 0583b2f
Showing
4 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
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,41 @@ | ||
# Testing Argo Rollouts | ||
|
||
Follow [argo rollouts installation](https://argo-rollouts.readthedocs.io/en/stable/installation/) instructions to install the controller and kubectl plugin | ||
|
||
## Actually Testing | ||
|
||
Deploy `install-prod.yaml` from [releases](https://github.com/Contrast-Security-OSS/agent-operator/releases). | ||
|
||
```bash | ||
# Install the production manifests. | ||
kubectl apply -f install-prod.yaml | ||
|
||
# Wait for the cluster to converge. | ||
watch kubectl -n contrast-agent-operator get pods | ||
|
||
# Check the logs for any problems. | ||
kubectl -n contrast-agent-operator logs deployment/contrast-agent-operator -f | ||
``` | ||
|
||
Then we can deploy argo rollout examples | ||
|
||
```bash | ||
# Install the Argo Rollout only examples (e.g. Rollout). | ||
kubectl apply -k ./manifests/examples/argo-rollouts | ||
|
||
# Promote the rollout to finish the agent injection | ||
kubectl argo rollouts promote dotnet-core-app | ||
|
||
# Inspect rollout in another terminal | ||
kubectl argo rollouts get rollout dotnet-core-app --watch | ||
``` | ||
|
||
We can also force a change on the container to trigger a rollout | ||
|
||
```bash | ||
# Optional: Force a change to the container to trigger a rollout | ||
kubectl argo rollouts set image dotnet-core-app dotnet-core-app=contrast/sample-app-aspnetcore:main | ||
|
||
# Promote the rollout to finish | ||
kubectl argo rollouts promote dotnet-core-app | ||
``` |
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,33 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: dotnet-core-app | ||
namespace: default | ||
labels: | ||
app: dotnet-core-app | ||
spec: | ||
replicas: 2 | ||
strategy: | ||
canary: | ||
steps: | ||
- setWeight: 20 | ||
- pause: {} | ||
- setWeight: 40 | ||
- pause: {duration: 10} | ||
revisionHistoryLimit: 1 | ||
selector: | ||
matchLabels: | ||
app: dotnet-core-app | ||
template: | ||
metadata: | ||
labels: | ||
app: dotnet-core-app | ||
annotations: | ||
test: test | ||
spec: | ||
containers: | ||
- image: contrast/sample-app-aspnetcore:latest | ||
name: dotnet-core-app | ||
ports: | ||
- containerPort: 80 | ||
name: http |
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,52 @@ | ||
apiVersion: agents.contrastsecurity.com/v1beta1 | ||
kind: AgentInjector | ||
metadata: | ||
name: example-injector-dotnet-core | ||
spec: | ||
enabled: true | ||
version: latest | ||
type: dotnet-core | ||
selector: | ||
images: | ||
- "*" | ||
labels: | ||
- name: app | ||
value: dotnet-core-app | ||
connection: | ||
name: example-agent-connection | ||
configuration: | ||
name: example-agent-configuration | ||
--- | ||
apiVersion: agents.contrastsecurity.com/v1beta1 | ||
kind: AgentConnection | ||
metadata: | ||
name: example-agent-connection | ||
spec: | ||
url: http://localhost | ||
apiKey: | ||
secretName: example-agent-connection-secret | ||
secretKey: apiKey | ||
serviceKey: | ||
secretName: example-agent-connection-secret | ||
secretKey: serviceKey | ||
userName: | ||
secretName: example-agent-connection-secret | ||
secretKey: userName | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: example-agent-connection-secret | ||
type: Opaque | ||
stringData: | ||
apiKey: apiKey | ||
serviceKey: serviceKey | ||
userName: userName | ||
--- | ||
apiVersion: agents.contrastsecurity.com/v1beta1 | ||
kind: AgentConfiguration | ||
metadata: | ||
name: example-agent-configuration | ||
spec: | ||
yaml: | | ||
enabled: true |
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,4 @@ | ||
namespace: default | ||
resources: | ||
- base/dotnet-core.yaml | ||
- base/minimal-setup.yaml |