Skip to content

Commit

Permalink
Merge pull request #680 from opendevstack/fix/create-kind-with-registry
Browse files Browse the repository at this point in the history
fix for #679
  • Loading branch information
michaelsauter authored Mar 20, 2023
2 parents ca46bcb + 50650f8 commit 8b5c511
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ listed in the changelog.

## [Unreleased]

### Fixed

- make create-kind-with-registry failed locally on mac ([#679](https://github.com/opendevstack/ods-pipeline/issues/679))

## [0.11.0] - 2023-03-14

### Changed
Expand Down
40 changes: 22 additions & 18 deletions scripts/kind-with-registry.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/bash
#
# Adapted from:
# https://github.com/kubernetes-sigs/kind/commits/master/site/static/examples/kind-with-registry.sh
#
# Copyright 2020 The Kubernetes Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
#
# Adapted from:
# https://github.com/kubernetes-sigs/kind/commits/master/site/static/examples/kind-with-registry.sh
#
# Copyright 2020 The Kubernetes Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
Expand Down Expand Up @@ -76,7 +76,7 @@ if [ "${running}" != 'true' ]; then
if [ "${reg_network}" != "bridge" ]; then
docker network create "${reg_network}" || true
fi

docker run \
-d --restart=always -p "${REGISTRY_PORT}:5000" --name "${REGISTRY_NAME}" --net "${reg_network}" \
registry:2
Expand All @@ -103,7 +103,11 @@ nodes:
extraMounts:
- hostPath: ${ODS_PIPELINE_DIR}/test
containerPath: /files
containerdConfigPatches:
kubeadmConfigPatches:
- |
kind: KubeletConfiguration
cgroupDriver: systemd
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${REGISTRY_PORT}"]
endpoint = ["http://${reg_ip}:${REGISTRY_PORT}"]
Expand Down

0 comments on commit 8b5c511

Please sign in to comment.