kops can't update aws cluster. RequestTimeout - amazon-web-services

I have an issue with k8s cluster on aws.
I tried to create cluster on aws.
The first step was creation:
kops create cluster --name=kubernetes.xarva.stream --state=s3://kops-bucket-pnz-se-kube1 --node-count=2 --node-size=t2.micro --master-size=t2.micro --dns-zone=kubernetes.xarva.stream --zones=eu-central-1a
and it was successfully completed. But when I tried to update the cluster with the command:
kops update cluster kubernetes.xarva.stream --state=s3://kops-b ucket-pnz-se-kube1 --yes
I got this error:
error writing completed cluster spec: error writing configuration file s3://kops -bucket-pnz-se-kube1/kubernetes.xarva.stream/cluster.spec: error writing s3://ko ps-bucket-pnz-se-kube1/kubernetes.xarva.stream/cluster.spec: RequestTimeout: You r socket connection to the server was not read from or written to within the tim eout period. Idle connections will be closed.
status code: 400, request id: 2***********3, host id: *********************************************6
On the s3 bucket I found the configuration, so seems that it's read issue.
Does anybody face with this problem? Any ideas how to solve it?
Thanks

RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
This error says you have a problem with access to AWS S3 from a place where you have installed kops.
Make sure you have access to S3 and try again or try to do this from another place.

Related

AWS Deployment failure due to missing appspec.yml when it is already present

I set up the pipeline three months ago and everything has been running fine with the same appspec.yml. But now suddenly AWS CodeDeploy gives the error that it can't find the appspec.yml although it is already there.It failed at the very first ApplicationStop event itself. The error is as follows:
The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. (Error code: HEALTH_CONSTRAINTS)
Then when I looked into the details, this is what it said:
My appspec.yml is as follows:
version: 0.0
os: windows
files:
- source: \
destination: c:\home\afb
file_exists_behavior: OVERWRITE
I also have the folder (c:\home\afb) created already on my EC2 instance. The health of the EC2 instance is fine as I can see on the Dashboard and also access it via RDP. The CodeDeploy agent is also running fine on EC2.
Please help. Thanks in advance for any advice!

Error: action failed after 10 attempts: failed to connect to the management cluster. Get https://127.0.0.1:43343/api?timeout=30s: EOF

I am creating an EKS-Anywhere local cluster by following these steps: Create local cluster | EKS Anywhere
Getting the following error after executing this command.
eksctl anywhere create cluster -f $CLUSTER_NAME.yaml
Performing setup and validations
Warning: The docker infrastructure provider is meant for local development and testing only
✅ Docker Provider setup is valid
Creating new bootstrap cluster
Installing cluster-api providers on bootstrap cluster
Provider specific setup
Creating new workload cluster
Installing networking on workload cluster
Installing storage class on workload cluster
Installing cluster-api providers on workload cluster
Moving cluster management from bootstrap to workload cluster
Error: failed to create cluster: error moving CAPI management from source to target: failed moving management cluster: Performing move...
Discovering Cluster API objects
Moving Cluster API objects Clusters=1
Creating objects in the target cluster
Deleting objects from the source cluster
Error: action failed after 10 attempts: failed to connect to the management cluster: action failed after 9 attempts: Get https://127.0.0.1:43343/api?timeout=30s: EOF
Upgrade your cert-manager
There is known issue: clusterctl init fails when existing cert-manager runs 1.0+ · Issue #3836 · kubernetes-sigs/cluster-api
And there is a solution: ⚠️ Upgrade cert-manager to v1.1.0 by fabriziopandini · Pull Request #4013 · kubernetes-sigs/cluster-api
And it works:
Cluster API is using cert-manager v1.1.0 now, so this should not be a problem anymore
So, I'd suggest upgrading.
It could be a resource constraint on your docker deployment. How much RAM and disk is Docker configured with. I have something like 16gb RAM and 60 gig disk which is more than required, but it does work.

Kinesis agent failing to start

I am trying to setup a kinesis agent on an Amazon EC2 instance which is supposed to be preinstalled.
But when I run the command:
sudo service aws-kinesis-agent start
It gives an error.. can someone help?

Cluster Autoscaling on AWS not scaling

Stumped on this issue and hoping someone who knows more can help me.
Trying to follow a guide with a proof of concept for cluster autoscaling on AWS for Kubernetes (https://renzedevries.wordpress.com/2017/01/10/autoscaling-your-kubernetes-cluster-on-aws/). I built my cluster on AWS using kops following this guide (https://medium.com/containermind/how-to-create-a-kubernetes-cluster-on-aws-in-few-minutes-89dda10354f4).
The issue appears to be with the cluster autoscaling deployment. When I run:
kubectl logs cluster-autoscaler-
I get the following output:
I0706 13:26:36.338072 1 leaderelection.go:210] failed to renew
lease kube-system/cluster-autoscaler
I0706 13:26:38.776977 1 leaderelection.go:210] failed to renew
lease kube-system/cluster-autoscaler
I0706 13:26:43.119763 1 leaderelection.go:210] failed to renew
lease kube-system/cluster-autoscaler
I0706 13:26:47.116439 1 leaderelection.go:210] failed to renew
I've been looking into the error and it was to do with the namespace. When I run the pod in a different namespace or the namespace recommended (kube-system - https://github.com/kubernetes/contrib/issues/2402) I still get the same error. Not sure what it causing it.
Thanks in advance for the help!
Follow this guide here to configure Cluster Autoscaler for Kubernetes running in AWS.
Configure Cluster Autoscaler in Kubernetes
It should do the work without any errors.

aws kops create cluster errors out as InvalidClientTokenId

I am actually trying to deploy my application using Kubernetes in the AWS Kops. For this i followed the steps given in the AWS workshop tutorial.
https://github.com/aws-samples/aws-workshop-for-kubernetes/tree/master/01-path-basics/101-start-here
I created a AWS Cloud9 environment by logging in as a IAM user and installed kops and other required software's as well. When i try to create the cluster using the following command
kops create cluster --name cs.cluster.k8s.local --zones $AWS_AVAILABILITY_ZONES
--yes
i get an error like below in the cloud9 IDE
error running tasks: deadline exceeded executing task IAMRole/nodes.cs.cluster.k8s.local. Example error: error creating IAMRole: InvalidClientTokenId: The security token included in the request is invalid
status code: 403, request id: 30fe2a97-0fc4-11e8-8c48-0f8441e73bc3
I am not able to find a way to solve this issue. Any help on this would be appreciable.
I found the issue and fixed it. Actually
I did not export the following 2 environment variables in the terminal where I am running create cluster. These 2 below variables are required while creating a cluster using kops
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)