-
Notifications
You must be signed in to change notification settings - Fork 0
NAIS deploy #118
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
Merged
Merged
NAIS deploy #118
Changes from 81 commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
24ba37e
NAIS deploy
mallport e535d40
Merge branch 'master' into nais-deploy
mallport 92a13a3
Merge branch 'master' into nais-deploy
mallport 6213fa5
Merge branch 'master' into nais-deploy
mallport c3eb29b
Temporarily deploy on PR commit
mallport 86887cf
Add NAIS Keycloak as trusted issuer
mallport 5b40d46
Fix PR deploy branch
mallport 3d5d3bc
Merge branch 'master' into nais-deploy
mallport 933325b
Forgor to save
mallport 7aeae39
Fix application config. Add variable for templating
mallport ccc50e5
Add team as templated variable
mallport 0092d99
yaml -> yml
mallport e806f4d
Add Keycloak for egress
mallport 60eae1b
Add Keycloak BIP for egres
mallport 74c3ab7
add prod release
mallport 36fcc0c
Use pseudo users
mallport 20fc430
Use pseudo admins
mallport aee750a
Lower resources in test
mallport fe8395e
Add internal ingress for prod. Add external egress for test
mallport 0cd43b3
Remove test subdomain from ingress URL
mallport f641eeb
add alerts for pseudo-service (#119)
ssb-jnk 94a5601
alert-deploy.yml (#120)
ssb-jnk 772643d
change high memory usage to fetch memory dynamically
ssb-jnk 3ae7013
edit high memory alert
ssb-jnk 3ee443c
revert to putting max memory manually
ssb-jnk 49cd6d7
change expression for HighMemoryUsage
ssb-jnk 6104e91
use container_memory_working_set_bytes instead
ssb-jnk cef7587
Add port and protocol
mallport 2e9d7fb
revert environment detection
mallport bef19c6
Remove 'service' block
mallport 2985ae7
add outbound egress
mallport edea32c
fix URL
mallport b1359cd
test with VirtualService host URL
mallport 5ef77d7
Add quotes for URL
mallport e749f51
Use public alertconfig
mallport 03686fd
Run alertconfig deploy from branch
mallport 78c6664
Add custom alert deploy
mallport b0c9d69
Add cluster info
mallport bdb5444
Remove quotes
mallport 55f2afc
fix templating
mallport cae88a9
add qutoes for cluster label
mallport 0a5c5cf
Add cluster to label
mallport 690995c
remove cluster var
mallport db2014d
Add var cluster
mallport 609f435
Add team info for alerts
mallport c398549
fix capitalization
mallport 5d17176
trigger alert deploy
mallport 1f5f5c3
New deploy of app
mallport 335b983
Trigger deploy
mallport 064c2df
redeploy
mallport f26a738
add new workflow
mallport 9849fe4
Add egress rule to sid lookup service
mallport 2492e01
Also add outbound rule for prod
mallport 5da78f5
Update SID URL
mallport 44580d4
Fix double http
mallport 8265aff
Attempt without ingress
mallport 3d38307
add 8080
mallport 80e4ded
use service discovery
mallport c57b0a9
Set correct service discovery for prod. Increase resources
mallport 6ee6140
Use protected configmap for app roles
mallport 66e3453
Fix SID service URL
mallport c5722a0
Deploy to prod
mallport 0bc0602
Fix indent
mallport 683fd94
Remove elevated pseudo users
mallport 3d93570
Debug why KMS URI is not being read
mallport f239860
Change name of configmaps
mallport 0bdba1b
Add quotes around env variable
mallport 2094250
Explicitly convert to URI
mallport 54b8abb
fix compilation error
mallport ee777bd
reset debugging chnages
mallport 8317fed
Merge branch 'master' into nais-deploy
mallport d6adab5
Add login for Swagger
mallport 0e731f5
trigger deploy
mallport e517df0
Increase proxy body size
mallport c6a8a9f
deploy to both prod and test
mallport 07443ea
Remove refernces to BIP keycloak
mallport 818ab69
add timeouts
mallport 33b44e6
Add health endpoint
mallport fd3119e
increase replica
mallport e05c913
prepare for release
mallport 04f99cf
remove alert depploy
mallport 7ad1218
re-add release
mallport 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
This file contains hidden or 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,65 @@ | ||
| name: Deploy alerts | ||
| run-name: Deploy alerts for Pseudo Service to test and prod | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - ".nais/alerts.yaml" | ||
| - ".github/workflows/alert-deploy.yml" | ||
| workflow_dispatch: | ||
| permissions: | ||
| id-token: write | ||
| env: | ||
| TEAM: dapla-stat | ||
|
|
||
| jobs: | ||
| test-deploy: | ||
| name: Deploy alerts to test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| name: Retrieve AlertManager configuration | ||
| with: | ||
| repository: "statisticsnorway/nais-alert-config" | ||
| path: "ext_alertconfig" | ||
| sparse-checkout: | | ||
| alertconfig.yaml | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Deploy to test | ||
| uses: nais/deploy/actions/deploy@v2 | ||
| env: | ||
| CLUSTER: test | ||
| RESOURCE: .nais/alerts.yaml,ext_alertconfig/alertconfig.yaml | ||
| VAR: cluster=test,team=${{ env.TEAM }} | ||
| DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443 | ||
|
|
||
| prod-deploy: | ||
| name: Deploy alerts to prod | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| name: Retrieve AlertManager configuration | ||
| with: | ||
| repository: "statisticsnorway/nais-alert-config" | ||
| path: "ext_alertconfig" | ||
| sparse-checkout: | | ||
| alertconfig.yaml | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Deploy to prod | ||
| uses: nais/deploy/actions/deploy@v2 | ||
| env: | ||
| CLUSTER: prod | ||
| RESOURCE: .nais/alerts.yaml,ext_alertconfig/alertconfig.yaml | ||
| VAR: cluster=prod,team=${{ env.TEAM }} | ||
| DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443 | ||
|
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,86 @@ | ||
| apiVersion: "monitoring.coreos.com/v1" | ||
| kind: PrometheusRule | ||
| metadata: | ||
| name: alert-pseudo-service | ||
| namespace: dapla-stat | ||
| labels: | ||
| team: dapla-stat | ||
| cluster: "{{cluster}}" | ||
| spec: | ||
| groups: | ||
| - name: dapla-stat | ||
| rules: | ||
| # This alert checks if no replicas of pseudo-service are available, indicating the service is unavailable. | ||
| - alert: PseudoServiceUnavailable | ||
| expr: kube_deployment_status_replicas_available{deployment="pseudo-service"} == 0 | ||
| for: 1m | ||
| annotations: | ||
| title: "Pseudo-service is unavailable" | ||
| consequence: "The service is unavailable to users. Immediate investigation required." | ||
| action: "Check the deployment status and logs for issues." | ||
| labels: | ||
| service: pseudo-service | ||
| namespace: dapla-stat | ||
| severity: critical | ||
| alertmanager_custom_config: dapla-stat | ||
| alert_type: custom | ||
|
|
||
| # This alert detects high CPU usage by calculating the CPU time used over 5 minutes. | ||
| - alert: HighCPUUsage | ||
| expr: rate(process_cpu_seconds_total{app="pseudo-service"}[5m]) > 0.8 | ||
| for: 5m | ||
| annotations: | ||
| title: "High CPU usage detected" | ||
| consequence: "The service might experience performance degradation." | ||
| action: "Investigate the cause of high CPU usage and optimize if necessary." | ||
| labels: | ||
| service: pseudo-service | ||
| namespace: dapla-stat | ||
| severity: warning | ||
| alertmanager_custom_config: dapla-stat | ||
| alert_type: custom | ||
|
|
||
| # This alert checks if memory usage exceeds 90% of the 12GB limit, which could cause instability. | ||
| - alert: HighMemoryUsage | ||
| expr: sum by (namespace, pod) (container_memory_working_set_bytes{namespace="dapla-stat", pod=~"pseudo-service-.*"}) > 0.9 * sum by (namespace, pod) (kube_pod_container_resource_limits_memory_bytes{namespace="dapla-stat", pod=~"pseudo-service-.*"}) | ||
| for: 5m | ||
| annotations: | ||
| title: "High memory usage detected" | ||
| consequence: "The service might experience instability due to high memory usage." | ||
| action: "Check memory utilization and consider increasing resources or optimizing the service." | ||
| labels: | ||
| service: pseudo-service | ||
| namespace: dapla-stat | ||
| severity: warning | ||
| alertmanager_custom_config: dapla-stat | ||
| alert_type: custom | ||
|
|
||
| # This alert detects a high number of error logs in pseudo-service. | ||
| - alert: HighNumberOfErrors | ||
| expr: (100 * sum by (app, namespace) (rate(log_messages_errors{app="pseudo-service", level=~"Error"}[3m])) / sum by (app, namespace) (rate(log_messages_total{app="pseudo-service"}[3m]))) > 10 | ||
| for: 3m | ||
| annotations: | ||
| title: "High number of errors logged in pseudo-service" | ||
| consequence: "The application is logging a significant number of errors." | ||
| action: "Check the service logs for errors and address the root cause." | ||
| labels: | ||
| service: pseudo-service | ||
| namespace: dapla-stat | ||
| severity: critical | ||
| alertmanager_custom_config: dapla-stat | ||
| alert_type: custom | ||
|
|
||
| # This alert monitors the number of pod restarts for pseudo-service and triggers if more than 3 restarts occur within 15 minutes. | ||
| - alert: HighPodRestarts | ||
| expr: increase(kube_pod_container_status_restarts_total{namespace="dapla-stat", app="pseudo-service"}[15m]) > 3 | ||
| for: 15m | ||
| annotations: | ||
| title: "High number of pod restarts" | ||
| consequence: "The service may be unstable or misconfigured." | ||
| action: "Investigate the cause of pod restarts and fix configuration or resource issues." | ||
| labels: | ||
| service: pseudo-service | ||
| namespace: dapla-stat | ||
| severity: warning | ||
| alertmanager_custom_config: dapla-stat | ||
| alert_type: custom |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.