#kubernetes - April 2019

btai
btaiover 7 years ago
would it be bad practice to deploy my CI tool in the same k8s cluster as what it is deploying?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Depends on what you want to accomplish with the CI tool
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
For example if you want the CI tool to upgrade the cluster it operates in, that won’t work
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
However no reason to limit yourself to one CI service
btai
btaiover 7 years ago
no
btai
btaiover 7 years ago
k8s cluster would hold the app and the CI tool that deploys the app
Tim Malone
Tim Maloneover 7 years ago
probably ok but maybe in a different namespace?
btai
btaiover 7 years ago
@Tim Malone that would be the plan yeah
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
casey
caseyover 7 years ago
hi all I have a quick question regarding dns zones which I am unsure of, if anyone could help it would be much appreciated.
casey
caseyover 7 years ago
I want my domain name to be example.com. I have a hosted zone in aws route53 for example.com, which sits in my root account (I can not move it from the root account at this time, because its being used). I have another aws account called production which contains the hosted zone production.example.com, this account is also where my eks cluster is in. In my root account route53 zone example.com i have an NS record production.example.com so that the production account can handle those domains.
casey
caseyover 7 years ago
If I use external-dns in my eks cluster, and allow it to create records in the production.example.com hosted zone, will my ssl cert hold? The SSL cert I have is a wildcard for *.example.com, and the records that get created from external-dns will look like *.production.example.com
casey
caseyover 7 years ago
I believe that they wont, but I am not sure. Is there any common way to handle this kind of situtation?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
We request SSL certificates In each account separately
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
The root certificate will not work in different accounts
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
So prod.example.com will have its own certificate
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
With wildcard
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
and even if you created all environments in one account, a cert for *.<http://example.com|example.com> could be used for <http://prod.example.com|prod.example.com>, but will not apply to *.<http://prod.example.com|prod.example.com>
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
You mean certs? :) They are free on AWS because they can be used only with other AWS resources for which you pay, e.g. load balancers . Not with servers external to AWS
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
and they are automatically renewed on AWS 🙂 (which will save you a lot of headache because we always forget to renew them 🙂 )
Alex Siegman
Alex Siegmanover 7 years ago
I know kops is somewhat intentionally behind Kubernetes in releases, but it looks like they are only "stable" on 1.11, which technically went EOL when 1.14 went GA if I'm not mistaken. That seems like a really slow release cadence to me. Is it still the go-to for doing home-spun K8S in AWS? EKS isn't keeping up either.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Yea I am not sure why it’s slowed
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
kube-aws is also worth checking out. @mumoshu is a maintainer.
Alex Siegman
Alex Siegmanover 7 years ago
That's the one you mentioned two weeks ago that I didn't write down. Will take a look. Thanks! 😃
casey
caseyover 7 years ago
has anyone had any luck installing kiam on eks?
Mark Grube
Mark Grubeover 7 years ago
yeah I am using kiam on eks
casey
caseyover 7 years ago
how did you install it? I tried with with the helmfile in cloudposses repo, but no luck.
casey
caseyover 7 years ago
Im pretty sure it's because I couldn't run the kiam server on a master node since eks doesnt let you do that
Mark Grube
Mark Grubeover 7 years ago
I did a separate node-group for kiam-server that has the required credentials
Mark Grube
Mark Grubeover 7 years ago
i used the stable helm chart to install it
casey
caseyover 7 years ago
what do you mean node-group ?
Mark Grube
Mark Grubeover 7 years ago
add --kubelet-extra-args --node-labels=${name_of_node_group} to your userdata
Mark Grube
Mark Grubeover 7 years ago
that lets you use a nodeSelector when deploying your pods
casey
caseyover 7 years ago
ah okay so do you have one node specifically for kiam? or do you run other pods on it as well?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
In our case, we run kiam servers on masters
Mark Grube
Mark Grubeover 7 years ago
i have a few daemonsets like node exporter, but not any other applications
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
And agents on all other nodes
Mark Grube
Mark Grubeover 7 years ago
yeah you can’t run stuff on eks masters that I am aware of
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Oh right
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Yea we use kops predominantly
Mark Grube
Mark Grubeover 7 years ago
The kiam-server node will have the ability to assume any role, so its best not to run anything else on it
Tim Malone
Tim Maloneover 7 years ago
Re kops release schedule having slowed, anything to do with EKS perhaps? i.e. is pickup of kops slowing too?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I wonder... could be
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Also the number of options available means there’s not as much support for anyone offering
btai
btaiover 7 years ago
how do you avoid merging maps in helm?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
have a more concrete example? @btai
btai
btaiover 7 years ago
i think it might be the way the chart is written
btai
btaiover 7 years ago
@Erik Osterman (Cloud Posse) basically for this chart: https://github.com/helm/charts/blob/master/stable/drone/values.yaml#L153
btai
btaiover 7 years ago
that DRONE_DATABASE_DATASOURCE can be set as a postgres url i.e. <postgres://username:pw@hostname/dbname>
btai
btaiover 7 years ago
but I set that as an envSecret value to pull from a k8s secret: https://github.com/helm/charts/blob/master/stable/drone/values.yaml#L159
btai
btaiover 7 years ago
but i guess when the values get merged for the deployment, the secret env vars get written first then the default env vars: https://github.com/helm/charts/blob/master/stable/drone/templates/deployment-server.yaml#L74
btai
btaiover 7 years ago
so the DRONE_DATABASE_DATASOURCE value gets overriden by the default sqlite value
btai
btaiover 7 years ago
possibly just a poorly written helm chart?
btai
btaiover 7 years ago
or is there a way of ignoring those default values
btai
btaiover 7 years ago
let me know if that makes any sense..
Ufou
Ufouover 7 years ago
@btai you can run helm with debug/dryrun enabled - this should show you how the values are being generated which may help you work out what/why a variable value is not as expected
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
awesome idea! anytime you need a shared secret, generate it ☝️
Issif
Issifover 7 years ago
I use it, very useful : https://github.com/derailed/k9s
Ryan Smith
Ryan Smithover 7 years ago
@Erik Osterman (Cloud Posse) You were able to convert @stobiewankenobi lolololol

Terraform -> SSM
Then aws-ssm + helm + helmfile at deploy time

SSM is beastmode.. love using serverless.com pulling from there also
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
hahaha 😃 FTW!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
🙇
deftunix
deftunixover 7 years ago
hi all, anyone has experience with eks to assign a pool of static ip address/eni to pods based on the AWS high availability zone?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
haven't seen that done before; don't know if it's possible
Ryan Smith
Ryan Smithover 7 years ago(edited)
@Erik Osterman (Cloud Posse) (or anyone) I got a fundamental question for ya..

What's the difference between:
- a canary deployment with 5% increments
- a rolling update with maxUnavailable==0 && maxSurge==5% (with a RR Load Balancer in front)
Ryan Smith
Ryan Smithover 7 years ago
(no rush.. food for thought)
Ryan Smith
Ryan Smithover 7 years ago(edited)
What I'm thinking about is.. can a native rolling update be used in place of a canary deployment.. Assuming they can monitor the same metrics for health
Ryan Smith
Ryan Smithover 7 years ago
Because.. spinnaker / istio just for the sake of canary might not be reason enough
Ryan Smith
Ryan Smithover 7 years ago
🤷‍♂️ midnight thoughts
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Ryan Smith I often use this example when talking to customers that out of the box, kubernetes supports a very basic form of canary+rolling updates. The reason for istio is to have full control over that process. Also, the "gold standard" for canary deployments is to tie it into your monitoring backplane so that you proceed to increase the level of traffic only so long as some KPIs are true. This level of controlled rollouts are more difficult to orchestrate with kubernetes primitives, which is why Istio is used. Also, it doesn't have to be limited to blue/green. It can be a full rainbow of colors, where the traffic is spread across them.
Ryan Smith
Ryan Smithover 7 years ago
💰️
Ryan Smith
Ryan Smithover 7 years ago
Makes a ton of sense
Ryan Smith
Ryan Smithover 7 years ago
I think we're all saying the same thing.. or at least on the same train of thought. It's definitely a nice thing to have as business requirements expand (as they always do). Soon enough, it'll become a required thing to have. 😉
btai
btaiover 7 years ago
what are y’all thoughts on 3 clusters/3az vs 1 cluster/3az? does the 3 cluster approach give us much more reliable availability?
btai
btaiover 7 years ago
for the 3 cluster approach either using federation or dns round robin
Mark Grube
Mark Grubeover 7 years ago
1 cluster, 3 az’s, multi-master setup
Mark Grube
Mark Grubeover 7 years ago
if you want more clusters, set those up in different regions instead with dns failover and/or geo/round robin load balancing between them
btai
btaiover 7 years ago
Anyone run tillerless helm? https://rimusz.net/tillerless-helm/
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that's interesting!
Alexander Tolstikov
Alexander Tolstikovover 7 years ago
does someone have something to say about https://www.ovh.co.uk/kubernetes/ ?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Haven’t used that in particular... I used OVH back in the day with CoreOS. Loved the service for the value. Unlimited bandwidth and beefy bare metal instances.
Ryan Smith
Ryan Smithover 7 years ago
https://github.com/roboll/helmfile/issues/392#issuecomment-455065039 @Erik Osterman (Cloud Posse) I feel like I need to write some middleware for Helmfile so it can use SSM directly
Ryan Smith
Ryan Smithover 7 years ago
lol think just right here
Mark Grube
Mark Grubeover 7 years ago
Has anyone found a good solution for user management on EKS? The best solution I can find is setting up roles that users can assume, but it doesn’t seem like an optimal solution.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
have you looked at Gravitational Teleport?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
it supports integration with SSO
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
and audited session logs with replay
Mark Grube
Mark Grubeover 7 years ago
I haven’t, but I will take a look!
Mark Grube
Mark Grubeover 7 years ago
Thanks @Erik Osterman (Cloud Posse)
Ryan Smith
Ryan Smithover 7 years ago
https://github.com/roboll/helmfile/pull/569 SSM integration with Helmfile. Lets see the lash-back. lol