Puppet+kubernetes: How do I describe a Kubernetes Pod in Puppet DSL?

0 votes
I am using puppetlabs/kubernetes module to configure my kubernetes cluster using puppet. I'm stuck as to how do I describe my pod in puppet DSL. Please help!
Aug 21, 2019 in Puppet by Karan
• 18,400 points
75 views

1 answer to this question.

0 votes

The Puppet Kubernetes module currently assumes you already have a Kubernetes cluster up and running. Its focus is on managing the resources in Kubernetes, like Pods, Replication Controllers and Services, not (yet) on managing the underlying kubelet or etcd services. Here’s a quick snippet of code describing a Pod in Puppet’s DSL.

kubernetes_pod { 'sample-pod':
  ensure => present,
  metadata => {
    namespace => 'default',
  },
  spec => {
    containers => [{
      name => 'container-name',
      image => 'nginx',
    }]
  },

Running the above code, assuming we save it as pod.pp, is as simple as:

puppet apply pod.pp

answered Aug 21, 2019 by Sirajul
• 58,130 points

Related Questions In Puppet

0 votes
1 answer
0 votes
1 answer

How do I start a puppet server?

Hey if you're using Ubuntu, you can ...READ MORE

answered Feb 21, 2019 in Puppet by Kavyashri
89 views
0 votes
1 answer

How do I enable puppet collection repository in puppet if I am using Puppet 6.7?

In Puppet6.7 you have to enable Puppet ...READ MORE

answered Jul 31, 2019 in Puppet by Sirajul
• 58,130 points
287 views
0 votes
1 answer

Puppet: How do i setup puppet module behind a proxy?

To use the puppet module command behind a proxy, ...READ MORE

answered Aug 9, 2019 in Puppet by Sirajul
• 58,130 points
784 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
8,754 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,970 points

reshown Apr 12, 2019 by Kalgi 2,636 views
0 votes
1 answer

Puppet in Docker: How do I query PuppetDB API in a container setup?

PuppetDB exposes a dashboard, showing various operational ...READ MORE

answered Aug 20, 2019 in Puppet by Sirajul
• 58,130 points
315 views
0 votes
1 answer