Skip to content

Commit 77aa3c8

Browse files
committed
Add support for k8s 1.20
K8s certification 1.20 Change k8s version Change controller version Add support for 1.20 Update integration_test.yml Update integration_test.yml remove comments Delete pr_test.yml Update kubeadm.pp Update worker.pp Update repos.pp Update templates Update integration_test.yml Update integration_test.yml Last updates Update spec_helper_acceptance_local.rb Update integration_test.yml Update integration_test.yml
1 parent 03235ac commit 77aa3c8

File tree

9 files changed

+178
-51
lines changed

9 files changed

+178
-51
lines changed

.github/workflows/integration_test.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
run: |
2626
echo STEP_ID=setup-environment >> $GITHUB_ENV
2727
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28+
2829
- name: Checkout Source
2930
uses: actions/checkout@v2
3031
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -42,24 +43,28 @@ jobs:
4243
echo ::group::bundler environment
4344
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4445
echo ::endgroup::
46+
4547
- name: "Honeycomb: Record Setup Environment time"
4648
if: ${{ github.repository_owner == 'puppetlabs' }}
4749
run: |
4850
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
4951
echo STEP_ID=Setup-Integration-Test-Matrix >> $GITHUB_ENV
5052
echo STEP_START=$(date +%s) >> $GITHUB_ENV
53+
5154
- name: Setup Integration Test Matrix
5255
id: get-matrix
5356
run: |
5457
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
55-
echo "::set-output name=matrix::{'platform':['centos-7'],'collection':['puppet6-nightly', 'puppet7-nightly']}"
58+
echo "::set-output name=matrix::{'platform':['centos-7'],'collection':['puppet7-nightly']}"
5659
else
5760
echo "::set-output name=matrix::{}"
5861
fi
62+
5963
- name: "Honeycomb: Record Setup Test Matrix time"
6064
if: ${{ always() }}
6165
run: |
6266
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
67+
6368
Integration:
6469
needs:
6570
- setup_matrix
@@ -116,35 +121,39 @@ jobs:
116121
echo STEP_START=$(date +%s) >> $GITHUB_ENV
117122
- name: Provision test environment
118123
run: |
119-
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::provision_cluster gcp_image=${{ matrix.platform }}
124+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::provision_cluster image_type=${{ matrix.platform }}
120125
echo ::group::=== REQUEST ===
121126
cat request.json || true
122127
echo
123128
echo ::endgroup::
124129
echo ::group::=== INVENTORY ===
125-
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
130+
if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; then
131+
FILE='spec/fixtures/litmus_inventory.yaml'
132+
elif [ -f 'inventory.yaml' ]; then
133+
FILE='inventory.yaml'
134+
fi
135+
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
126136
echo ::endgroup::
127-
- name: Disable gpg check google-cloud.repo
128-
uses: nick-invision/retry@v1
129-
with:
130-
timeout_minutes: 30
131-
max_attempts: 5
132-
retry_wait_seconds: 60
133-
command: buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes::disable_gpg' -- bundle exec bolt --modulepath spec/fixtures/modules command run "sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/google-cloud.repo" --targets '*' -i ./inventory.yaml
137+
echo INVENTORY_PATH=$FILE >> $GITHUB_ENV
138+
134139
- name: Puppet server setup
135140
run: |
136-
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes::puppetserver_setup' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::puppetserver_setup -i ./inventory.yaml
141+
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes::puppetserver_setup' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::puppetserver_setup collection='${{ matrix.collection }}' -i ./$INVENTORY_PATH
142+
137143
- name: Install agent
138-
uses: nick-invision/retry@v1
139-
with:
140-
timeout_minutes: 30
141-
max_attempts: 5
142-
retry_wait_seconds: 60
143-
command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
144+
run: |
145+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
144146
145147
- name: Install module
146148
run: |
147149
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
150+
151+
- name: Start SSH session
152+
uses: luchihoratiu/debug-via-ssh@main
153+
with:
154+
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
155+
SSH_PASS: ${{ secrets.SSH_PASS }}
156+
148157
- name: "Honeycomb: Record deployment times"
149158
if: ${{ always() }}
150159
run: |
@@ -157,23 +166,26 @@ jobs:
157166
- name: Run integration tests
158167
run: |
159168
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes:integration' -- bundle exec rake kubernetes:integration
169+
160170
- name: "Honeycomb: Record integration testing times"
161171
if: ${{ always() }}
162172
run: |
163173
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run integration tests'
164174
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
165175
echo STEP_START=$(date +%s) >> $GITHUB_ENV
176+
166177
- name: Remove test environment
167178
if: ${{ always() }}
168179
continue-on-error: true
169180
run: |
170-
if [ -f inventory.yaml ]; then
181+
if [ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]; then
171182
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
172183
echo ::group::=== REQUEST ===
173184
cat request.json || true
174185
echo
175186
echo ::endgroup::
176187
fi
188+
177189
- name: "Honeycomb: Record removal times"
178190
if: ${{ always() }}
179191
run: |

.github/workflows/nightly.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
run: |
2828
echo STEP_ID=setup-environment >> $GITHUB_ENV
2929
echo STEP_START=$(date +%s) >> $GITHUB_ENV
30+
3031
- name: Checkout Source
3132
uses: actions/checkout@v2
3233
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -44,12 +45,14 @@ jobs:
4445
echo ::group::bundler environment
4546
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4647
echo ::endgroup::
48+
4749
- name: "Honeycomb: Record Setup Environment time"
4850
if: ${{ github.repository_owner == 'puppetlabs' }}
4951
run: |
5052
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5153
echo STEP_ID=Setup-Integration-Test-Matrix >> $GITHUB_ENV
5254
echo STEP_START=$(date +%s) >> $GITHUB_ENV
55+
5356
- name: Setup Integration Test Matrix
5457
id: get-matrix
5558
run: |
@@ -58,10 +61,12 @@ jobs:
5861
else
5962
echo "::set-output name=matrix::{}"
6063
fi
64+
6165
- name: "Honeycomb: Record Setup Test Matrix time"
6266
if: ${{ always() }}
6367
run: |
6468
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
69+
6570
Integration:
6671
needs:
6772
- setup_matrix
@@ -118,28 +123,33 @@ jobs:
118123
echo STEP_START=$(date +%s) >> $GITHUB_ENV
119124
- name: Provision test environment
120125
run: |
121-
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::provision_cluster gcp_image=${{ matrix.platform }}
126+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::provision_cluster image_type=${{ matrix.platform }}
122127
echo ::group::=== REQUEST ===
123128
cat request.json || true
124129
echo
125130
echo ::endgroup::
126131
echo ::group::=== INVENTORY ===
127-
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
132+
if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; then
133+
FILE='spec/fixtures/litmus_inventory.yaml'
134+
elif [ -f 'inventory.yaml' ]; then
135+
FILE='inventory.yaml'
136+
fi
137+
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
128138
echo ::endgroup::
129-
- name: Install module
139+
echo INVENTORY_PATH=$FILE >> $GITHUB_ENV
140+
141+
- name: Puppet server setup
130142
run: |
131-
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes::puppetserver_setup' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::puppetserver_setup -i ./inventory.yaml
143+
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes::puppetserver_setup' -- bundle exec bolt --modulepath spec/fixtures/modules plan run kubernetes::puppetserver_setup collection='${{ matrix.collection }}' -i ./$INVENTORY_PATH
144+
132145
- name: Install agent
133-
uses: nick-invision/retry@v1
134-
with:
135-
timeout_minutes: 30
136-
max_attempts: 5
137-
retry_wait_seconds: 60
138-
command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
146+
run: |
147+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
139148
140149
- name: Install module
141150
run: |
142151
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
152+
143153
- name: "Honeycomb: Record deployment times"
144154
if: ${{ always() }}
145155
run: |
@@ -152,23 +162,26 @@ jobs:
152162
- name: Run integration tests
153163
run: |
154164
buildevents cmd $TRACE_ID $STEP_ID 'rake kubernetes:integration' -- bundle exec rake kubernetes:integration
165+
155166
- name: "Honeycomb: Record integration testing times"
156167
if: ${{ always() }}
157168
run: |
158169
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run integration tests'
159170
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
160171
echo STEP_START=$(date +%s) >> $GITHUB_ENV
172+
161173
- name: Remove test environment
162174
if: ${{ always() }}
163175
continue-on-error: true
164176
run: |
165-
if [ -f inventory.yaml ]; then
177+
if [ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]; then
166178
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
167179
echo ::group::=== REQUEST ===
168180
cat request.json || true
169181
echo
170182
echo ::endgroup::
171183
fi
184+
172185
- name: "Honeycomb: Record removal times"
173186
if: ${{ always() }}
174187
run: |

manifests/repos.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
repos => pick($kubernetes_apt_repos,'main'),
3131
release => pick($kubernetes_apt_release,'kubernetes-xenial'),
3232
key => {
33-
'id' => pick($kubernetes_key_id,'54A647F9048D5688D7DA2ABE6A030B21BA07F4FB'),
33+
'id' => pick($kubernetes_key_id,'7F92E05B31093BEF5A3C2D38FEEA9169307EA071'),
3434
'source' => pick($kubernetes_key_source,'https://packages.cloud.google.com/apt/doc/apt-key.gpg'),
3535
},
3636
}

plans/provision_cluster.pp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
# Provisions machines for integration testing
44
#
55
# @example
6-
# kubernetes::provision_integration
6+
# kubernetes::provision_cluster
77
plan kubernetes::provision_cluster(
8-
Optional[String] $gcp_image = 'centos-7',
8+
Optional[String] $image_type = 'centos-7',
9+
Optional[String] $provision_type = 'provision_service',
910
) {
1011
#provision server machine, set role
11-
run_task('provision::provision_service', 'localhost',
12-
action => 'provision', platform => $gcp_image, vars => 'role: controller')
13-
run_task('provision::provision_service', 'localhost',
14-
action => 'provision', platform => $gcp_image, vars => 'role: worker1')
15-
run_task('provision::provision_service', 'localhost',
16-
action => 'provision', platform => $gcp_image, vars => 'role: worker2')
12+
run_task("provision::$provision_type", 'localhost',
13+
action => 'provision', platform => $image_type, vars => 'role: controller')
14+
run_task("provision::$provision_type", 'localhost',
15+
action => 'provision', platform => $image_type, vars => 'role: worker1')
16+
run_task("provision::$provision_type", 'localhost',
17+
action => 'provision', platform => $image_type, vars => 'role: worker2')
1718
}

plans/puppetserver_setup.pp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1+
# @summary Provisions machines
2+
#
3+
# Puppet Server Setup
4+
#
5+
# @example
6+
# kubernetes::puppetserver_setup
17
plan kubernetes::puppetserver_setup(
8+
Optional[String] $collection = 'puppet7-nightly'
29
) {
310
$puppet_server = get_targets('*').filter |$n| { $n.vars['role'] == 'controller' }
4-
$puppet_server_string = $puppet_server[0].name
5-
# install pe server
6-
run_task('provision::install_puppetserver', $puppet_server)
11+
12+
# get facts
13+
$puppet_server_facts = facts($puppet_server[0])
14+
$platform = $puppet_server_facts['platform']
15+
16+
# install puppet server
17+
run_task(
18+
'provision::install_puppetserver',
19+
$puppet_server,
20+
'install and configure server',
21+
{ 'collection' => $collection, 'platform' => $platform }
22+
)
723
}
824

925

spec/acceptance/integration_kubernetes_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@
4545
after(:all) { reset_target_host }
4646
describe 'verify the k8 nodes' do
4747
it 'verify the k8 nodes' do
48+
run_shell('sleep 20')
4849
run_shell('KUBECONFIG=/etc/kubernetes/admin.conf kubectl get nodes') do |r|
49-
expect(r.stdout).to match(/#{hostname1} Ready master/)
50-
expect(r.stdout).to match(/#{hostname2} Ready/)
51-
expect(r.stdout).to match(/#{hostname3} Ready/)
50+
expect(r.stdout).to match(/#{hostname1}(\s)+Ready(\s)+master/)
51+
expect(r.stdout).to match(/#{hostname2}(\s)+Ready/)
52+
expect(r.stdout).to match(/#{hostname3}(\s)+Ready/)
5253
end
5354
end
5455
end

spec/acceptance/kubernetes_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
pp = <<-MANIFEST
1414
if $facts['os']['family'] == 'redhat'{
1515
class {'kubernetes':
16-
kubernetes_version => '1.16.6',
17-
kubernetes_package_version => '1.16.6',
16+
kubernetes_version => '1.20.0',
17+
kubernetes_package_version => '1.20.0',
1818
controller_address => "$::ipaddress:6443",
1919
container_runtime => 'docker',
2020
manage_docker => false,

0 commit comments

Comments
 (0)