From 081f28f9de58e32a0cc1fe8e088e38defbabf62b Mon Sep 17 00:00:00 2001 From: Phantom-Intruder Date: Tue, 21 Nov 2023 12:22:13 +0530 Subject: [PATCH] Conflic resolution --- Keda101/keda-lab.md | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Keda101/keda-lab.md b/Keda101/keda-lab.md index 8e41cacc..56a92b13 100644 --- a/Keda101/keda-lab.md +++ b/Keda101/keda-lab.md @@ -120,7 +120,23 @@ serviceAccount: The part that needs to be modified is the `annotations` section. So if you want to scale an EKS cluster based on SQS messages, then you first need an IAM role that has access to SQS, and you need to add this role arn as an annotation. -<<<<<<< HEAD +``` +annotations: + eks.amazonaws.com/role-arn: arn:aws:iam:::role/ +``` + +Next, you need to change the ScaleObject resource. The mysql-hpa.yaml has the trigger specified as the mysql db. However, it does not have an option called `identityOwner`. This is becase we are not using authentication here, and therefore do not need such a thing. In order to add authentication, this key should be added and the value set to `operator`: + +``` +metadata: + ... + identityOwner: operator +``` + +And that's it! You only needed to modify two lines and you have full authorization among the cluster. + +While this is the easiest way to provide authentication, it is not the only way to do it. You could also change the `identityOwner` to `pod`, and create a `TriggerAuthentication` resource and feed in the AWS access keys (which isn't very secure), or have the keda service account assume a role that has access to the necessary resources (which is much more secure). There is a number of different ways to authorize, and these are covered in the [KEDA documentation](https://keda.sh/docs/1.4/concepts/authentication/). + If you added the arn, then setting up authentication is a simple matter. While Keda provides resources specifically geared towards authentication, you won't need to use any of that. In the Keda authentication types, there exists a type called `operator`. This type allows the keda service account to directly acquire the role of the IAM arn you provided. As long as the arn has the permissions necessary, keda can function. The triggers will look like the following: ```yaml @@ -176,24 +192,6 @@ authenticationRef: This will allow your `ScaledJob` resource to read the authentication keys that you added to your secret via the `TriggerAuthentication` resource. Of course, if you don't want to have your access keys even as a secret, you can use the operator authentication type described above. Additionally, Keda support [several different authentication types](https://keda.sh/docs/2.11/concepts/authentication/) out of the box. With the above configuration, a new Keda job will start every time a message is sent to the SQS queue. The job should have the necessary configurations to read the content of the message sent to the queue, and the message in SQS should get consumed by the job that starts. Once the job succeeds, it will terminate. If there is a failure, the job will exit and a new job will get created. It will then attempt to consume the message. -======= -``` -annotations: - eks.amazonaws.com/role-arn: arn:aws:iam:::role/ -``` - -Next, you need to change the ScaleObject resource. The mysql-hpa.yaml has the trigger specified as the mysql db. However, it does not have an option called `identityOwner`. This is becase we are not using authentication here, and therefore do not need such a thing. In order to add authentication, this key should be added and the value set to `operator`: - -``` -metadata: - ... - identityOwner: operator -``` - -And that's it! You only needed to modify two lines and you have full authorization among the cluster. - -While this is the easiest way to provide authentication, it is not the only way to do it. You could also change the `identityOwner` to `pod`, and create a `TriggerAuthentication` resource and feed in the AWS access keys (which isn't very secure), or have the keda service account assume a role that has access to the necessary resources (which is much more secure). There is a number of different ways to authorize, and these are covered in the [KEDA documentation](https://keda.sh/docs/1.4/concepts/authentication/). ->>>>>>> b68da965d466f37a94ab063b6a26328c2aa1c470 ## Conclusion