Skip to content

Instantly share code, notes, and snippets.

@petems
Created March 7, 2016 12:59
Show Gist options
  • Save petems/cea5753bd15b76bc10c3 to your computer and use it in GitHub Desktop.
Save petems/cea5753bd15b76bc10c3 to your computer and use it in GitHub Desktop.
Kubernetes in Docker with Puppet
docker::image { 'gcr.io/google_containers/etcd':
image_tag => '2.0.9'
}
docker::image { 'gcr.io/google_containers/hyperkube':
image_tag => 'v0.17.0'
}
wget::fetch { 'kubectl':
source => "https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl",
destination => "/tmp/kubectl"
} ->
file { '/usr/bin/kubectl':
mode => 0755,
source => '/tmp/kubectl'
} ->
wget::fetch { 'kubectl_bash':
source => "https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/4ba22e713ad95dfb308d0b9aca7ac9d980414bf6/contrib/completions/bash/kubectl",
destination => "/etc/bash_completion.d/kubectl"
}
->
kubernetes_pod { 'nginx-pod':
ensure => present,
metadata => {
namespace => 'default',
},
spec => {
containers => [{
name => 'nginx-example',
image => 'nginx',
}]
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment