-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from kartverket/enable_onprem
Enable onprem clusters
- Loading branch information
Showing
2 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,13 @@ on: | |
required: true | ||
description: 'Project service account to use for authentication. Full address is expected. Example: [email protected]' | ||
type: string | ||
commands: | ||
namespace: | ||
required: true | ||
description: 'Multiline string of commands to run with kubectl. Example: "get pods\nget services".' | ||
description: 'Kubernetes namespace to use for kubectl commands. Example: default' | ||
type: string | ||
namespace: | ||
commands: | ||
required: true | ||
description: 'Namespace to run the command in. Example: my-namespace' | ||
description: 'Multiline string of commands to run with kubectl. Example: "get pods\nget services".' | ||
type: string | ||
kubectl_version: | ||
required: false | ||
|
@@ -37,8 +37,8 @@ env: | |
SERVICE_ACCOUNT: ${{ inputs.service_account }} | ||
CLUSTER_NAME: ${{ inputs.cluster_name }} | ||
KUBERNETES_PROJECT_ID: ${{ inputs.kubernetes_project_id }} | ||
NAMESPACE: ${{ inputs.namespace }} | ||
KUBECTL_VERSION: ${{ inputs.kubectl_version }} | ||
NAMESPACE: ${{ inputs.namespace }} | ||
|
||
jobs: | ||
deploy: | ||
|
@@ -70,15 +70,19 @@ jobs: | |
with: | ||
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ env.SERVICE_ACCOUNT }} | ||
|
||
- id: 'get-credentials' | ||
uses: google-github-actions/get-gke-credentials@v2 | ||
with: | ||
cluster_name: ${{ env.CLUSTER_NAME }} | ||
location: 'europe-north1' | ||
use_connect_gateway: 'true' | ||
project_id: ${{ env.KUBERNETES_PROJECT_ID }} | ||
namespace: ${{ env.NAMESPACE }} | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v2 | ||
|
||
- name: Authenticate with Kubernetes | ||
run: | | ||
gcloud components install gke-gcloud-auth-plugin | ||
gcloud container hub memberships get-credentials $CLUSTER_NAME --verbosity debug | ||
- name: Set kubectl namespace | ||
run: | | ||
kubectl config set-context --current --namespace=$NAMESPACE | ||
- name: 'Execute kubectl commands' | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,8 +61,9 @@ jobs: | |
service_account: [email protected] | ||
kubernetes_project_id: kube-dev-4329023 | ||
kubernetes_project_number: 43290432893 | ||
command: restart deployment my-deployment | ||
namespace: default | ||
command: | | ||
restart deployment my-deployment | ||
``` | ||
### Inputs | ||
|