k8s-aws | A kops wrapper script for bootstrapping Kubernetes on AWS | AWS library
kandi X-RAY | k8s-aws Summary
kandi X-RAY | k8s-aws Summary
A kops wrapper script for bootstrapping Kubernetes on AWS
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of k8s-aws
k8s-aws Key Features
k8s-aws Examples and Code Snippets
Community Discussions
Trending Discussions on k8s-aws
QUESTION
I originally posted this question as an issue on the GitHub project for the AWS Load Balancer Controller here: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2069.
I'm seeing some odd behavior that I can't trace or explain when trying to get the loadBalacnerDnsName from an ALB created by the controller. I'm using v2.2.0 of the AWS Load Balancer Controller in a CDK project. The ingress that I deploy triggers the provisioning of an ALB, and that ALB can connect to my K8s workloads running in EKS.
Here's my problem: I'm trying to automate the creation of a Route53 A Record that points to the loadBalancerDnsName
of the load balancer, but the loadBalancerDnsName
that I get in my CDK script is not the same as the loadBalancerDnsName
that shows up in the AWS console once my stack has finished deploying. The value in the console is correct and I can get a response from that URL. My CDK script outputs the value of the DnsName as a CfnOutput value, but that URL does not point to anything.
In CDK, I have tried to use KubernetesObjectValue
to get the DNS name from the load balancer. This isn't working (see this related issue: https://github.com/aws/aws-cdk/issues/14933), so I'm trying to lookup the Load Balancer with CDK's .fromLookup
and using a tag that I added through my ingress annotation:
ANSWER
Answered 2021-Jun-13 at 20:23I think that the answer is to use external-dns.
ExternalDNS allows you to control DNS records dynamically via Kubernetes resources in a DNS provider-agnostic way.
QUESTION
I use an open-source server application running on Docker Compose. It has a few services, including PostgreSQL DB and Redis.
How can I best deploy this application to AWS in full IaC with Terraform?
ecs-cli
ecs-cli
now supports sending docker compose
configs in Amazon ECS.
However, I do not think it could be integrated with the Terraform workflow (which is maybe not a big fuss). What I know for sure is that ecs-cli
is not supported in CloudFormation, as per this issue, still open at this time. So I assume it cannot easily be added to Terraform either.
- Take your
docker-compose.yml
file, translate it tokubectl
YAML. - (Prepare to doing so every time the package upgrades).
- Deploy using Terraform's + EKS APIs (minimal example).
But that is not fully IaC yet. And you have to retranslate your config each time the docker-compose changes in the source repository. And it sounds like a lot of work.
3. Using a Helm chart- Write a Helm chart for the application.
- Run Terraform to start a cluster.
- Still run Terraform with a
helm
provider to install the application with Helm on the cluster.
I read Kompose can automagically translate a Docker Compose configuration to a k8s configuration, but they don't appear to be ported on AWS, not to talk about Terraform.
5. [Not OK] The dirty AMI solution- Build a custom EC2 AMI with Packer.
- Using Terraform, set up the DB, Redis and all permissions / network / etc.
- Start an EC2 instance with the custom AMI.
- The AMI contains (customized) application code, especially the
docker-compose.yml
. And the Docker images. - The AMI starts a Docker Compose
systemctl
service.
That would kind of hurt: long builds, difficult monitoring, no scaling.
Side notes- I mentioned I need full IaC. What I mean by it is:
- The written config (and it only) on
master
tells you what is deployed. - The deploy will complete without my team having to run any other command. It basically works either on CI/CD or on single-push'n'go.
- Monitoring and alerting are easily configured in the IaC.
- The written config (and it only) on
- I wish to replace some services with AWS components (namely, the PostgreSQL service by an RDS, and the Redis service with an ElastiCache).
- The application happens to be Apache Superset. However I am also wondering what is considered the best general approach to this Docker Compose problem.
ANSWER
Answered 2020-Apr-20 at 14:22Who knows, ecs-cli-v2
might be better integrated with CloudFormation and/or Terraform.
As mentioned in the question. Probably the best solution, albeit requiring a (little) effort to parametrize Helm.
See also: Getting started with Helm.
3. Docker Swarm + CloudFormation + TerraformDocker Swarm now accepts inputs from a docker-compose.yml
file. The template can be found and configured here. Once configured, it may be integrated to a Terraform infrastructure.
This (3-year old) tutorial explains how to use Docker Swarm mode on AWS.
To launch the container, if necessary (not fully investigated, feedback is welcome), you could use Terraform's local-exec
. This way you can SSH into the master node and run docker stack deploy
and other similar commands, while still having all written down in IaC style.
QUESTION
How can I get a Kubernetes authentication token from AWS EKS using the AWS Java SDK v2? An authentication token that can then be used to authenticate with Kubernetes using a Kubernetes SDK. In other words I want to get an authentication token from EKS to use for authentication with Kubernetes so that I don't have to create a "kube config".
I actually got a solution working with AWS Java SDK v1 (not v2) looking at the code examples in the following open issue. There is also a Python code example here BUT I'm not having any success with AWS Java SDK v2. My attempt at doing it with AWS Java SDK v2:
...ANSWER
Answered 2020-Feb-26 at 04:23Okay, I finally got it working.
The AWS Java SDK v2 version:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install k8s-aws
You can use k8s-aws like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page