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
• 19,610 points
557 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
• 59,230 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
427 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
• 59,230 points
984 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
• 59,230 points
2,936 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
14,614 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 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,106 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
• 59,230 points
897 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP