Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cluster id secret && support nodeport service for testing purposes #13

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/iks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE }}
REGISTRY_HOSTNAME: us.icr.io
IMAGE_NAME: hello-python
IKS_CLUSTER: bq1sm2gd0sjtps7ajoa0 # name or id of cluster
IKS_CLUSTER: ${{ secrets.IKS_CLUSTER_ID }} # create secrets for cluster id or name
DEPLOYMENT_NAME: hello-python
PORT: 5001

Expand All @@ -43,7 +43,7 @@ jobs:
# Authenticate with IBM Cloud CLI
- name: Authenticate with IBM Cloud CLI
run: |
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g default
ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g Default
ibmcloud cr region-set "${IBM_CLOUD_REGION}"
ibmcloud cr login

Expand All @@ -70,3 +70,6 @@ jobs:
kubectl create service loadbalancer $DEPLOYMENT_NAME --tcp=80:$PORT --dry-run -o yaml > service.yaml
kubectl apply -f service.yaml
kubectl get services -o wide
# also you can do that on nodeport service if you have free cluster setup
# kubectl expose deployment $DEPLOYMENT_NAME --type=NodePort --name=$DEPLOYMENT_NAME --port=31558 --target-port=$PORT --selector=app=$DEPLOYMENT_NAME --dry-run=client -o yaml > nodeport-service.yaml
# kubectl apply -f nodeport-service.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repo contains a sample GitHub Action for deploying an application to IBM Ku

1. If you'd like to use the file yourself fork the repo and open [.github/workflows/iks.yml](.github/workflows/iks.yml), you'll need to update a few environment variables.
1. Add your own IKS cluster name, image name, and deployment name.
1. In your GitHub repository settings create two secrets, `ICR_NAMESPACE` and `IBM_CLOUD_API_KEY`.
1. In your GitHub repository settings create three secrets, `ICR_NAMESPACE` , `IBM_CLOUD_API_KEY` and `IKS_CLUSTER_ID`.

Get a new IBM Cloud API key from the [IAM settings](https://cloud.ibm.com/iam/apikeys).

Expand Down