Skip to content

Commit 397bb1a

Browse files
committed
Use env. variables for Kubernetes master address
1 parent 5a3228a commit 397bb1a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs-source/content/userguide/managing-domains/domain-lifecycle/scaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The scalingAction.sh script accepts a number of customizable parameters:
163163
* `kubernetes_master` - Kubernetes master URL, default=https://kubernetes
164164

165165
{{% notice note %}}
166-
Set this to https://kubernetes.default.svc when invoking `scalingAction.sh` from the Administration Server pod.
166+
Set this to https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT} when invoking `scalingAction.sh` from the Administration Server pod.
167167
{{% /notice %}}
168168

169169
* `access_token` - Service Account Bearer token for authentication and authorization for access to REST Resources

src/scripts/initialize-external-operator-identity.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
# Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

@@ -29,7 +29,7 @@ LEGACY_KEY_PEM=${OPERATOR_SECRETS_DIR}/${EXTERNAL_KEY}
2929

3030
CACERT='/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
3131
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`
32-
KUBERNETES_MASTER="https://kubernetes.default.svc"
32+
KUBERNETES_MASTER="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"
3333

3434
function cleanup {
3535
if [[ $SUCCEEDED != "true" ]]; then

src/scripts/initialize-internal-operator-identity.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

@@ -94,7 +94,7 @@ function generateInternalIdentity {
9494
function recordInternalIdentity {
9595
CACERT='/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
9696
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`
97-
KUBERNETES_MASTER="https://kubernetes.default.svc"
97+
KUBERNETES_MASTER="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"
9898

9999
# the request body prints out the atz token
100100
# don't specify -v so that the token is not printed to the operator log

src/scripts/scaling/scalingAction.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# Copyright 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

@@ -14,7 +14,7 @@ operator_namespace="weblogic-operator"
1414
operator_service_account="weblogic-operator"
1515
scaling_size=1
1616
access_token=""
17-
kubernetes_master="https://kubernetes"
17+
kubernetes_master="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"
1818

1919
# Parse arguments/parameters
2020
for arg in "$@"
@@ -69,12 +69,12 @@ done
6969
# Verify required parameters
7070
if [ -z "$scaling_action" ] || [ -z "$wls_domain_uid" ] || [ -z "$wls_cluster_name" ]
7171
then
72-
echo "Usage: scalingAction.sh --action=[scaleUp | scaleDown] --domain_uid=<domain uid> --cluster_name=<cluster name> [--kubernetes_master=https://kubernetes] [--access_token=<access_token>] [--wls_domain_namespace=default] [--operator_namespace=weblogic-operator] [--operator_service_name=weblogic-operator] [--scaling_size=1]"
72+
echo "Usage: scalingAction.sh --action=[scaleUp | scaleDown] --domain_uid=<domain uid> --cluster_name=<cluster name> [--kubernetes_master=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}] [--access_token=<access_token>] [--wls_domain_namespace=default] [--operator_namespace=weblogic-operator] [--operator_service_name=weblogic-operator] [--scaling_size=1]"
7373
echo " where"
7474
echo " action - scaleUp or scaleDown"
7575
echo " domain_uid - WebLogic Domain Unique Identifier"
7676
echo " cluster_name - WebLogic Cluster Name"
77-
echo " kubernetes_master - Kubernetes master URL, default=https://kubernetes"
77+
echo " kubernetes_master - Kubernetes master URL, default=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"
7878
echo " access_token - Service Account Bearer token for authentication and authorization for access to REST Resources"
7979
echo " wls_domain_namespace - Kubernetes name space WebLogic Domain is defined in, default=default"
8080
echo " operator_service_name - WebLogic Operator Service name, default=internal-weblogic-operator-svc"

0 commit comments

Comments
 (0)