{"id":327,"date":"2021-12-09T23:40:49","date_gmt":"2021-12-09T22:40:49","guid":{"rendered":"http:\/\/daisy-street.fr\/?p=327"},"modified":"2021-12-13T12:16:19","modified_gmt":"2021-12-13T11:16:19","slug":"ajout-pod-pihole-node","status":"publish","type":"post","link":"https:\/\/daisy-street.fr\/index.php\/2021\/12\/09\/ajout-pod-pihole-node\/","title":{"rendered":"Ajout pod pihole-node"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">deployement<\/h2>\n\n\n\n<p>La commande docker-compose avec le filesystem prepar\u00e9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>version: \"3\"\n\n# More info at https:\/\/github.com\/pi-hole\/docker-pi-hole\/ and https:\/\/docs.pi-hole.net\/\nservices:\n  pihole:\n    container_name: pihole\n    image: pihole\/pihole:latest\n    ports:\n      - \"53:53\/tcp\"\n      - \"53:53\/udp\"\n      - \"67:67\/udp\"\n      - \"80:80\/tcp\"\n    environment:\n      TZ: 'America\/Chicago'\n      # WEBPASSWORD: 'set a secure password here or it will be random'\n    # Volumes store your data between container upgrades\n    volumes:\n      - '.\/etc-pihole\/:\/etc\/pihole\/'\n      - '.\/etc-dnsmasq.d\/:\/etc\/dnsmasq.d\/'\n    # Recommended but not required (DHCP needs NET_ADMIN)\n    #   https:\/\/github.com\/pi-hole\/docker-pi-hole#note-on-capabilities\n    cap_add:\n      - NET_ADMIN\n    restart: unless-stopped<\/code><\/pre>\n\n\n\n<p>traduction en kubernetes deploy :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: piholeserver \r\n  namespace: default\r\n  labels:\r\n    app: pihole\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      app: pihole\r\n  template:\r\n    metadata:\r\n      labels:\r\n        run: piholeserver \r\n        app: pihole\r\n    spec:\r\n      containers:\r\n      - name: piholeserver \r\n        image: pihole\/pihole:latest\r\n        env:\r\n          - name: \"DNS1\"\r\n            value: \"9.9.9.9\"\r\n          - name: \"DNS2\"\r\n            value: \"149.112.112.112\"\r\n        ports:\r\n        - protocol: TCP\r\n          containerPort: 53\r\n          name: pihole-http53t\r\n        - protocol: UDP\r\n          containerPort: 53\r\n          name: pihole-http53u\r\n        - containerPort: 67\r\n          name: pihole-http67\r\n        - containerPort: 80\r\n          name: pihole-http\r\n        volumeMounts:\r\n        - mountPath: \/etc\/pihole\/\r\n          name: pihole-config\r\n        - mountPath: \/etc\/dnsmasq.d\/\r\n          name: pihole-dnsmasq\r\n      volumes:\r\n      - name: pihole-config\r\n        hostPath:\r\n          type: DirectoryOrCreate\r\n          path: \/usr\/kubedata\/piholeserver\/pihole\r\n      - name: pihole-dnsmasq\r\n        hostPath:\r\n          type: DirectoryOrCreate\r\n          path: \/usr\/kubedata\/piholeserver\/dnsmasq.d\r\n---\t\t  \r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: pihole-svc\r\nspec:\r\n  selector:\r\n    app: pihole\r\n  ports:\r\n    - name: \"http53u\"\r\n      protocol: UDP\r\n      port: 53\r\n      targetPort: 53\r\n    - name: \"http53t\"\r\n      protocol: TCP\r\n      port: 53\r\n      targetPort: 53\r\n    - name: \"http67\"\r\n      port: 67\r\n      targetPort: 67\r\n    - name: \"http\"\r\n      port: 80\r\n      targetPort: 80\r\n      nodePort: 30499\r\n  type: NodePort<\/code><\/pre>\n\n\n\n<p>puis on recupere le port d\u2019exposition<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get all --all-namespaces | grep heimdall<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"74\" data-attachment-id=\"328\" data-permalink=\"https:\/\/daisy-street.fr\/index.php\/2021\/12\/09\/ajout-pod-pihole-node\/image-8-3\/\" data-orig-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8.png\" data-orig-size=\"1172,85\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-8\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-300x22.png\" data-large-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-1024x74.png\" src=\"http:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-1024x74.png\" alt=\"\" class=\"wp-image-328\" srcset=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-1024x74.png 1024w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-300x22.png 300w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8-768x56.png 768w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-8.png 1172w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>resultat le dashboard est accecible https:\/\/&lt;master-ip&gt;:31541<\/p>\n\n\n\n<p>Le password de l&#8217;admin est dans la log du pod<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"300\" data-attachment-id=\"330\" data-permalink=\"https:\/\/daisy-street.fr\/index.php\/2021\/12\/09\/ajout-pod-pihole-node\/image-9-3\/\" data-orig-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9.png\" data-orig-size=\"676,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-9\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9-300x133.png\" data-large-file=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9.png\" src=\"http:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9.png\" alt=\"\" class=\"wp-image-330\" srcset=\"https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9.png 676w, https:\/\/daisy-street.fr\/wp-content\/uploads\/2021\/12\/image-9-300x133.png 300w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><\/figure>\n\n\n\n<p>ou on peut definir un password en ligne de commande dans le pod<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pihole -a -p<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>deployement La commande docker-compose avec le filesystem prepar\u00e9 traduction en kubernetes deploy : puis on recupere le port d\u2019exposition resultat le dashboard est accecible https:\/\/&lt;master-ip&gt;:31541 Le password de l&#8217;admin est dans la log du pod ou on peut definir un password en ligne de commande dans le pod<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[33,50,9],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-non-classe","tag-kubernetes","tag-pihole","tag-serveur"],"jetpack_publicize_connections":[],"featured_image_src":null,"author_info":{"display_name":"admin9483","author_link":"https:\/\/daisy-street.fr\/index.php\/author\/admin9483\/"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":5,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/posts\/327\/revisions\/346"}],"wp:attachment":[{"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daisy-street.fr\/index.php\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}