danfromtitan / envars-from-node-labels Goto Github PK
View Code? Open in Web Editor NEWExport container environment variables from K8s node labels
License: Apache License 2.0
Export container environment variables from K8s node labels
License: Apache License 2.0
After adding this addmission controller, sometimes this error breaks helm release rollouts
warning: Upgrade "app" failed: cannot patch "app" with kind Deployment: Deployment.apps "app" is invalid: spec.template.spec.containers[0].env[38].valueFrom: Invalid value: "": may not be specified when `value` is not empty
We're using flux as well, but this error is popping up randomly in some contexts, does not seem to related to flux.
After adding this addmission controller, sometimes this error breaks helm release rollouts
warning: Upgrade "app" failed: cannot patch "app" with kind Deployment: Deployment.apps "app" is invalid: spec.template.spec.containers[0].env[38].valueFrom: Invalid value: "": may not be specified when `value` is not empty
We're using flux as well, but this error is popping up randomly in some contexts, does not seem to related to flux.
Hey buddy
Thanks for creating the chart for this, I'm just about to move to it but I noticed that the chart only allows one namespace to be selected as per:
namespaceSelector:
matchLabels:
name: {{ .Values.webhook.namespaceSelector }}
Any chance to get this adjusted to perhaps allow multiple namespaces or a custom label name?
Thanks
Currently AZ name is returned e.g. us-east-1c
NODE_TOPOLOGY_KUBERNETES_IO_ZONE=us-east-1c
There is case with Amazon managed Kafka service (MSK) when we can consume data from Kafka broker deployed same AZ with container - docs
In order to make it work both MSK and container should know AZ Identifier (not AZ name). As in particular MSK case Kafka brokers can only know AZ ID (provided by AWS).
AZ ID usually look something like use1-az3
. E.g. in my case AZ with name us-east-1e
has ID use1-az3
.
Sample call to AWS CLI
# aws ec2 describe-availability-zones
{
"AvailabilityZones": [
..
{
...
"RegionName": "us-east-1",
"ZoneName": "us-east-1e",
"ZoneId": "use1-az3",
...
Basically I'd like to have ZoneId
value too, not only ZoneName
currently provided.
Without it I have to make call to AWS API from container to resolve name to id, that kills all the elegance of admission controller usage :)
We're using spot instances thus pods lifecycle is pretty lively with moving pods to new instances terminating them, etc.
And recently we're started to see these kind of errors keeping our node off of termination gracefully:
secret envars-6659dc1b-d26c-413b-af17-c25ae946f4ec does not exist
Have you encountered something similar?
Something weird started to happen, when had just a common helm deploys, the envars started to log this:
2022/05/13 12:29:20 error creating secret envars-95237cb9-5396-499a-bd0a-dfb2d7660c62 in namespace black: secrets "envars-95237cb9-5396-499a-bd0a-dfb2d7660c62" already exists
Pods got stuck in Terminated/Pending, also can't seem to delete pods in Terminating/Pending state since it wants to communicate with the envars-webook:
Delete failed with Internal error occurred: failed calling webhook "envars-webhook.webhook.svc": Post "https://envars-webhook.webhook.svc:443/mutate?timeout=30s": no
│ Warning FailedScheduling 44s (x12 over 18m) default-scheduler binding rejected: running Bind plugin "DefaultBinder": Internal error occurred: failed calling web │
│ hook "envars-webhook.webhook.svc": Post "https://envars-webhook.webhook.svc:443/mutate?timeout=30s": no endpoints available for service "envars-webhook"
Our install looks like this:
resource "null_resource" "envars_from_node_labels_tls" {
count = var.cell_type == "bluestack" ? 1 : 0
triggers = {
cluster_instance_ids = filemd5("./scripts/tls.sh")
}
provisioner "local-exec" {
command = "./scripts/tls.sh"
}
depends_on = [
module.eks,
]
}
resource "null_resource" "envars_from_node_labels_deployment" {
count = var.cell_type == "bluestack" ? 1 : 0
triggers = {
cluster_instance_ids = filemd5("./manifests/admission-webhook.yaml")
}
provisioner "local-exec" {
command = <<-EOT
export CA_PEM_B64="$(kubectl get secret -n webhook envars-webhook-tls -o 'go-template={{index .data "ca.crt"}}')"
j2 ./manifests/admission-webhook.yaml | kubectl apply -f -
kubectl rollout restart -n webhook deployment envars-webhook || true
EOT
}
depends_on = [
null_resource.envars_from_node_labels_tls,
module.eks,
]
}
Do you know any possible clues for that errors?
Hi,
When I am trying to run my pods in another namespace. web hook is not triggering. I changed namespaceSelector
to proper namespace and enabled containers also. still it is not working. I don't see any logs in webhook pod also.
Am I missing anything.?
And FYI We are using kustomize
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.