/srv/irclogs.ubuntu.com/2020/08/17/#smooth-operator.txt

Chipacamo'in08:43
bthomasMorning08:43
bthomasI am on a do or die mission to refactor the prometheus charm (except tests) this week. I hope I will have a decent burial and epitaph if I fail.08:44
* bthomas needs more coffeeeeeeeee09:24
Chipacabthomas: what do you want on the wreath?09:36
Chipacabthomas: I'd go with YOLO09:36
bthomasChipaca: I always fancied "Shit Happens" from "Forrest Gump" (love that movie).09:43
* Chipaca bbiab10:10
gnuoyChipaca, sorry for the late notice but I don't have much to add from our last meeting. I'd suggest we skip it unless you have something you'd like to discuss ?11:57
Chipacagnuoy: skip it is :)11:58
gnuoyack, thanks11:59
Chipacagnuoy: you miss out on watching me do unthinkable things to a rather boring wrap11:59
gnuoyI'm sorry to have missed that :)13:02
Chipacayou're really not :)13:14
narinderguptaChipaca, I am facing weird issue where I set the PodSpec and run the k8s status in loop since workload status is unknown is fine. But it stops executing the pods nd pod never gets created?14:39
Chipacanarindergupta: juju's pod spec setting is transactional14:40
Chipacanarindergupta: i.e. it's applied after your hook finishes successfully14:40
Chipacanarindergupta: if you set it, and then wait for it to change in a loop in the same hook, you're going to have a bad time14:40
narinderguptaChipaca, oh ok do we have update_status event?14:40
Chipacanarindergupta: if you mean an event in juju about k8s status, not currently14:41
narinderguptaThinking of changing in update_status in that case?14:41
narinderguptaOh ok so what's the solution as if now as my juju unit status is unknown while my pod status is active14:42
Chipacanarindergupta: there is update-status, which runs every 5 minutes on a clock14:43
narinderguptaI think I can use that atleast so that status gets updated after 5 minutes.14:44
narinderguptaAnd once we have solution then I will switch in charm14:44
Chipacanarindergupta: you can make that shorter, see https://discourse.juju.is/t/whats-the-update-status-interval/2571/5?u=chipaca14:45
narinderguptaChipaca, Hun it is a model level change.14:47
Chipacayes14:48
Chipacajldev: you around?15:04
jldevChipaca: yes15:06
Chipacajldev: i'm wanting to leave a little early to get to physio on time, meaning i wouldn't be there at the start of the standup15:06
Chipacajldev: were you planning on going to the standup?15:07
jldevChipaca: yes, I'll be there, no worries if you need to leave early15:07
Chipacajldev: ok :)15:07
Chipacajldev: (i would've stayed if you couldn't make it, and just made it super-fast)15:07
narinderguptaChipaca, looks like pod status is fetching me unknown everytime from k8s which is weired. While kubectl pod status returns active16:58
Chipacanarindergupta: what's "pod status" in the above?17:22
Chipacaas opposed to "kubectl pod status" i mean17:22
narinderguptaChipaca, I am testing k8s api using the operator library17:22
narinderguptaChipaca,     k8s_pod_status = k8s.get_pod_status(juju_model=juju_model,17:23
narindergupta                                        juju_app=juju_app,17:23
narindergupta                                        juju_unit=juju_unit)17:23
narinderguptaDo I need to encode the parameters?17:24
Chipacanarindergupta: and what does the kubectl pod status output? (with -o yaml please)17:27
Chipacanarindergupta: or, better, what is in the debug log?17:28
Chipacaas that'll include the output i'm looking for17:28
Chipacanarindergupta: i'm looking for the log line that starts 'Received k8s pod status: '17:29
narinderguptaChipaca, unit.charm-k8s-cassandra/0.juju-log Received k8s pod status: <k8s.PodStatus object at 0x7f54cbb83df0>17:30
Chipacahah, lolfail17:30
Chipacai'll file a bug about that17:30
narindergupta:)17:30
Chipacanarindergupta: sorry, i'm going to need the output of the kubectl command17:30
narinderguptaChipaca, yes just a second17:30
narinderguptamicrok8s.kubectl get pods -n cassandra17:31
narinderguptaNAME                             READY   STATUS    RESTARTS   AGE17:31
narinderguptacharm-k8s-cassandra-0            1/1     Running   0          25m17:31
narinderguptacharm-k8s-cassandra-operator-0   1/1     Running   0          25m17:31
narinderguptamodeloperator-7d75bd7454-tfzgn   1/1     Running   0          25m17:31
narinderguptaIt says running17:31
Chipacanarindergupta: can you do: microk8s.kubectl get pods -n cassandra -o yaml | pastebinit -f yaml17:34
Chipacanarindergupta: (you might need to apt install pastebinit first)17:34
narinderguptaChipaca, somehow pastebinit is not working on this node17:34
Chipacaah17:34
narinderguptaI tried to upgrade this to 20.4 and pastbinit messed up now17:34
Chipacaok, so copy-paste into a pastebin, please17:35
narinderguptaYeah will do that give me a sec17:35
Chipacanarindergupta: and then show me more context of your code above that called get_pod_status, so i know the values of juju_model, _app, and _unit :)17:35
narinderguptaSure17:36
narinderguptaThose value I am getting from model but let me give you that first17:36
narindergupta    juju_model = self.model.name17:36
narindergupta    juju_app = self.model.app.name17:36
narindergupta    juju_unit = self.model.unit17:36
narinderguptaChipaca, https://paste.ubuntu.com/p/XqTrYrtBZR/17:50
narinderguptaChipaca, I have pasted only the Cassandra-pod status rather than operators as well.17:51
Chipacanarindergupta: charm-k8s-cassandra is the juju app name?17:52
narinderguptacurrect17:52
narinderguptacorrect17:52
narinderguptaAnd I can see the same in pod labels as well17:53
narinderguptaModel is cassandra17:53
Chipacanarindergupta: and charm-k8s-cassandra/0 is the unit?17:53
narinderguptaYes correct17:53
narinderguptajuju status17:53
narinderguptaModel      Controller  Cloud/Region        Version  SLA          Timestamp17:53
narinderguptacassandra  k8s-cloud   microk8s/localhost  2.8.1    unsupported  17:53:30Z17:53
narinderguptaApp                  Version                         Status  Scale  Charm                Store  Rev  OS          Address        Notes17:53
narinderguptacharm-k8s-cassandra  gcr.io/google-samples/cassa...  active      1  charm-k8s-cassandra  local    0  kubernetes  10.152.183.6617:53
narinderguptaUnit                    Workload     Agent  Address      Ports                       Message17:53
narinderguptacharm-k8s-cassandra/0*  maintenance  idle   10.1.16.172  7000/TCP,7001/TCP,9042/TCP  Waiting for pod to appear17:53
Chipacanarindergupta: from here it looks like it should work17:54
narinderguptaChipaca, let me send you my charm code as well in case that helps17:55
Chipacanarindergupta: can you send me an email, with the charm code and how to deploy it on microk8s?17:55
narinderguptaChipaca, ok17:55
ChipacaI'll review it as soon as I can (which is in no less than ~2 hours)17:55
Chipacathanks!17:55
narinderguptaChipaca, https://paste.ubuntu.com/p/s7FYfVqKKZ/17:55
narinderguptaMy charm code and I will send you in email as well17:56
narinderguptaLet me checkin into GitHub so ti would be easy for you to grab the whole charm17:57
narinderguptaChipaca, sent you an email and attached the charm code18:13
Chipacanarindergupta: reproduced the issue, debugging it now19:55
narinderguptaOk cool19:55
Chipacanarindergupta: i think i'm seeing something different though20:33
Chipacanarindergupta: my kubectl shows the cassandra pod in CrashLoopBackOff20:34
* Chipaca reinstalls just in case20:35
Chipacanarindergupta: yeah, it's always stuck in CrashLoopBackOff here20:41
narinderguptaChipaca, in meeting with manager20:42
narinderguptaChipaca, I can have a look after that but run juju debug-log and see20:42
Chipacanarindergupta: i think it might be that i was running an older juju20:46
Chipacaforgot i'd downgraded to test something else :)20:46
Chipacawill fix20:46
narinderguptaChipaca, :)20:46
narinderguptaI am sing 2.8.120:46
Chipacanarindergupta: and now i got it to status:active21:00
Chipacaah, there we go (spoke to soon? was impatient?)21:00
narinderguptaChipaca, still having crash21:05
Chipacano, now the kube side works21:06
narinderguptaChipaca, ok cool21:06
Chipacaso now i can look at the data and see what the k8s library is getting wrong :)21:06
narinderguptaBut k8 api library show unknown21:06
narinderguptaOk cool21:06
narindergupta juju status21:06
narinderguptaModel      Controller  Cloud/Region        Version  SLA          Timestamp21:06
narinderguptacassandra  k8s-cloud   microk8s/localhost  2.8.1    unsupported  21:05:31Z21:06
narinderguptaApp                  Version                         Status  Scale  Charm                Store  Rev  OS          Address         Notes21:06
narinderguptacharm-k8s-cassandra  gcr.io/google-samples/cassa...  active      1  charm-k8s-cassandra  local    0  kubernetes  10.152.183.22321:06
narinderguptaUnit                    Workload     Agent  Address      Ports                       Message21:06
narinderguptacharm-k8s-cassandra/0*  maintenance  idle   10.1.16.177  7000/TCP,7001/TCP,9042/TCP  Waiting for pod to appear21:06
narinderguptaHopefully you have the same status21:07
narinderguptaChipaca, I am stepping out please send me email if I do not respond on this channel21:20
Chipacanarindergupta: found the problem21:22
Chipacaor at least _a_ problem :-) seeing if it fixed it now21:24
Chipaca21:25

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!