Skip to content

Instantly share code, notes, and snippets.

@skinny
Last active October 13, 2022 06:35
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save skinny/96e7feb6b347299ebfacaa76295a82e7 to your computer and use it in GitHub Desktop.
Save skinny/96e7feb6b347299ebfacaa76295a82e7 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
component: resolv
tier: node
name: resolv
namespace: default
spec:
selector:
matchLabels:
component: resolv
tier: node
template:
metadata:
labels:
component: resolv
tier: node
spec:
containers:
- command: [ "nsenter", "-t", "1", "--mount", "--pid", "--uts", "--ipc", "--net", "--", "bash", "-c", "echo 'IyAgVGhpcyBmaWxlIGlzIHBhcnQgb2Ygc3lzdGVtZC4KIwojICBzeXN0ZW1kIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQKIyAgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CiMgIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIuMSBvZiB0aGUgTGljZW5zZSwgb3IKIyAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KIwojIEVudHJpZXMgaW4gdGhpcyBmaWxlIHNob3cgdGhlIGNvbXBpbGUgdGltZSBkZWZhdWx0cy4KIyBZb3UgY2FuIGNoYW5nZSBzZXR0aW5ncyBieSBlZGl0aW5nIHRoaXMgZmlsZS4KIyBEZWZhdWx0cyBjYW4gYmUgcmVzdG9yZWQgYnkgc2ltcGx5IGRlbGV0aW5nIHRoaXMgZmlsZS4KIwojIFNlZSByZXNvbHZlZC5jb25mKDUpIGZvciBkZXRhaWxzCgpbUmVzb2x2ZV0KI0ROUz0KRmFsbGJhY2tETlM9MTY4LjYzLjEyOS4xNgojRG9tYWlucz0KI0xMTU5SPW5vCiNNdWx0aWNhc3RETlM9bm8KI0ROU1NFQz1ubwojQ2FjaGU9eWVzCiNETlNTdHViTGlzdGVuZXI9eWVzCg==' | base64 -d > /etc/systemd/resolved.conf; cat /etc/systemd/resolved.conf;systemctl restart systemd-resolved.service;systemctl status systemd-resolved.service;echo result:$?; tail -f /dev/null" ]
#image: mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022-hotfix
image: mcr.microsoft.com/oss/kubernetes-csi/azuredisk-csi:v1.21.0
# Replace this image with an image that is present within your cluster
# Look at any daemonset in the kube-system namespace and use one of them
imagePullPolicy: IfNotPresent
name: bash
resources:
requests:
cpu: 100m
volumeMounts:
- name: dbus-sock
mountPath: /var/run/dbus/system_bus_socket
- name: run
mountPath: /run
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
hostPID: true
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: dbus-sock
hostPath:
path: /var/run/dbus/system_bus_socket
- name: run
hostPath:
path: /run
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
- effect: NoSchedule
operator: Exists
updateStrategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
@uncycler
Copy link

You might want to add toleration to apply everywhere:

tolerations:
  - key: CriticalAddonsOnly
    operator: Exists
  - effect: NoExecute
    operator: Exists
  - effect: NoSchedule
    operator: Exists

@OlivierMary
Copy link

Just 😘

@bchess
Copy link

bchess commented Aug 30, 2022

+1. Let me know where we can send gifts

@flipsasser
Copy link

+1 I also choose sending gifts. I'm being serious.

@pastukhov
Copy link

My eyes are bleeding
Why do you do nor put everything in a shell script and mont it with ConfigMap?

@pastukhov
Copy link

pastukhov commented Aug 31, 2022

Ok, guys!
Is everybody check that there is no rm -rf?

@skinny
Copy link
Author

skinny commented Aug 31, 2022

My eyes are bleeding Why do you do nor put everything in a shell script and mont it with ConfigMap?

Well, my clusters were bleeding and I was just trying to get my workloads pulling again asap.. Function over form in this case :)

@OlivierMary
Copy link

@pastukhov

IyAgVGhpcyBmaWxlIGlzIHBhcnQgb2Ygc3lzdGVtZC4KIwojICBzeXN0ZW1kIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQKIyAgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CiMgIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIuMSBvZiB0aGUgTGljZW5zZSwgb3IKIyAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4KIwojIEVudHJpZXMgaW4gdGhpcyBmaWxlIHNob3cgdGhlIGNvbXBpbGUgdGltZSBkZWZhdWx0cy4KIyBZb3UgY2FuIGNoYW5nZSBzZXR0aW5ncyBieSBlZGl0aW5nIHRoaXMgZmlsZS4KIyBEZWZhdWx0cyBjYW4gYmUgcmVzdG9yZWQgYnkgc2ltcGx5IGRlbGV0aW5nIHRoaXMgZmlsZS4KIwojIFNlZSByZXNvbHZlZC5jb25mKDUpIGZvciBkZXRhaWxzCgpbUmVzb2x2ZV0KI0ROUz0KRmFsbGJhY2tETlM9MTY4LjYzLjEyOS4xNgojRG9tYWlucz0KI0xMTU5SPW5vCiNNdWx0aWNhc3RETlM9bm8KI0ROU1NFQz1ubwojQ2FjaGU9eWVzCiNETlNTdHViTGlzdGVuZXI9eWVzCg==

==>

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
#DNS=
FallbackDNS=168.63.129.16
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes

So it's just the new resolve.conf with the fix FallbackDNS=168.63.129.16 maybe remove all commented lines make this more lighter...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment