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 in Puppet by Karan
• 3,250 points
12 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 by Sirajul
• 29,340 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 in Puppet by Kavyashri
29 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 in Puppet by Sirajul
• 29,340 points
31 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 in Puppet by Sirajul
• 29,340 points
53 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17 in Others by anonymous
2,511 views
+3 votes
1 answer
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 in Puppet by Sirajul
• 29,340 points
18 views
0 votes
1 answer