agones.dev/agones@v1.53.0/build/includes/kind.mk (about)

     1  # Copyright 2019 Google LLC All Rights Reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  
    16  #   _  ___           _
    17  #  | |/ (_)_ __   __| |
    18  #  | ' /| | '_ \ / _` |
    19  #  | . \| | | | | (_| |
    20  #  |_|\_\_|_| |_|\__,_|
    21  
    22  # creates a kind cluster for use with agones
    23  # Kind stand for Kubernetes IN Docker
    24  # You can change the cluster name using KIND_PROFILE env var
    25  kind-test-cluster: DOCKER_RUN_ARGS+=--network=host
    26  kind-test-cluster: $(ensure-build-image)
    27  	@if [ -z $$(kind get clusters | grep $(KIND_PROFILE)) ]; then\
    28  		echo "Could not find $(KIND_PROFILE) cluster. Creating...";\
    29  		kind create cluster --name $(KIND_PROFILE) --image kindest/node:v1.32.5 --wait 5m;\
    30  	fi
    31  
    32  # deletes the kind agones cluster
    33  # useful if you're want to start from scratch
    34  kind-delete-cluster:
    35  	kind delete cluster --name $(KIND_PROFILE)
    36  
    37  # start an interactive shell with kubectl configured to target the kind cluster
    38  kind-shell: $(ensure-build-image)
    39  	$(MAKE) shell DOCKER_RUN_ARGS="--network=host $(DOCKER_RUN_ARGS)"
    40  
    41  # installs the current dev version of agones
    42  # you should build-images and kind-push first.
    43  kind-install:
    44  	$(MAKE) install DOCKER_RUN_ARGS="--network=host" ALWAYS_PULL_SIDECAR=false \
    45  		IMAGE_PULL_POLICY=IfNotPresent PING_SERVICE_TYPE=NodePort ALLOCATOR_SERVICE_TYPE=NodePort
    46  
    47  # pushes the current dev version of agones to the kind single node cluster.
    48  kind-push:
    49  	kind load docker-image $(sidecar_linux_amd64_tag) --name="$(KIND_PROFILE)"
    50  	kind load docker-image $(controller_tag) --name="$(KIND_PROFILE)"
    51  	kind load docker-image $(ping_tag) --name="$(KIND_PROFILE)"
    52  	kind load docker-image $(allocator_tag) --name="$(KIND_PROFILE)"
    53  	kind load docker-image $(processor_tag) --name="$(KIND_PROFILE)"
    54  
    55  # Runs e2e tests against our kind cluster
    56  kind-test-e2e:
    57  	$(MAKE) DOCKER_RUN_ARGS=--network=host test-e2e
    58  
    59  # prometheus on kind
    60  # we have to disable PVC as it's not supported on kind.
    61  kind-setup-prometheus:
    62  	$(MAKE) setup-prometheus DOCKER_RUN_ARGS="--network=host" PVC=false \
    63  		HELM_ARGS="--set server.resources.requests.cpu=0,server.resources.requests.memory=0"
    64  
    65  # grafana on kind with dashboards and prometheus datasource installed.
    66  # we have to disable PVC as it's not supported on kind.
    67  kind-setup-grafana:
    68  	$(MAKE) setup-grafana DOCKER_RUN_ARGS="--network=host" PVC=false
    69  
    70  kind-setup-prometheus-stack:
    71  	$(MAKE) setup-prometheus-stack DOCKER_RUN_ARGS="--network=host" PVC=false \
    72  		HELM_ARGS="--set prometheus.server.resources.requests.cpu=0,prometheus.server.resources.requests.memory=0"
    73  
    74  # kind port forwarding controller web
    75  kind-controller-portforward:
    76  	$(MAKE) controller-portforward DOCKER_RUN_ARGS="--network=host"
    77  
    78  # kind port forwarding grafana
    79  kind-grafana-portforward:
    80  	$(MAKE) grafana-portforward DOCKER_RUN_ARGS="--network=host"
    81  
    82  # kind port forwarding for prometheus web ui
    83  kind-prometheus-portforward:
    84  	$(MAKE) prometheus-portforward DOCKER_RUN_ARGS="--network=host"