Thursday, December 14, 2023

Install kubectl on Fedora and start k8s cluster in GCP

 HOWTO




Install kubectl using RPM


dave@dave:~$ cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
EOF
[sudo] password for dave: 
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
dave@dave:~$ sudo yum install -y kubectl
Fedora 39 - x86_64 - Updates                                                                                                                                                                                                                                                                  118 kB/s |  16 kB     00:00    
Fedora 39 - x86_64 - Updates                                                                                                                                                                                                                                                                  1.8 MB/s | 2.7 MB     00:01    
Kubernetes                                                                                                                                                                                                                                                                                     12 kB/s | 5.7 kB     00:00    
Dependencies resolved.
==============================================================================================================================================================================================================================================================================================================================
 Package                                                                   Architecture                                                             Version                                                                                Repository                                                                    Size
==============================================================================================================================================================================================================================================================================================================================
Installing:
 kubectl                                                                   x86_64                                                                   1.29.0-150500.1.1                                                                      kubernetes                                                                    10 M

Transaction Summary
==============================================================================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 10 M
Installed size: 47 M
Downloading Packages:
kubectl-1.29.0-150500.1.1.x86_64.rpm                                                                                                                                                                                                                                                           12 MB/s |  10 MB     00:00    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                                                                          12 MB/s |  10 MB     00:00     
Kubernetes                                                                                                                                                                                                                                                                                    7.9 kB/s | 1.7 kB     00:00    
Importing GPG key 0x9A296436:
 Userid     : "isv:kubernetes OBS Project <isv:kubernetes@build.opensuse.org>"
 Fingerprint: DE15 B144 86CD 377B 9E87 6E1A 2346 54DA 9A29 6436
 From       : https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                                                                                      1/1 
  Installing       : kubectl-1.29.0-150500.1.1.x86_64                                                                                                                                                                                                                                                                     1/1 
  Verifying        : kubectl-1.29.0-150500.1.1.x86_64                                                                                                                                                                                                                                                                     1/1 

Installed:
  kubectl-1.29.0-150500.1.1.x86_64                                                                                                                                                                                                                                                                                            

Complete!
dave@dave:~$ 


Check k8s cluster via gcloud

$ gcloud container clusters list
NAME          LOCATION       MASTER_VERSION  MASTER_IP     MACHINE_TYPE  NODE_VERSION    NUM_NODES  STATUS
dave-cluster  europe-west10  1.27.3-gke.100  1.1.1.1  e2-small      1.27.3-gke.100  1          RUNNING


Connect to GKE from localhost via gcloud and kubectl

 sudo yum install google-cloud-sdk-gke-gcloud-auth-plugin
[sudo] password for dave: 
Last metadata expiration check: 0:29:49 ago on Thu 14 Dec 2023 10:05:11 AM CET.
Dependencies resolved.
==================================================================================================================================================================================================================
 Package                                                                 Architecture                           Version                                    Repository                                        Size
==================================================================================================================================================================================================================
Installing:
 google-cloud-sdk-gke-gcloud-auth-plugin                                 x86_64                                 457.0.0-1                                  google-cloud-sdk                                 3.6 M

Transaction Summary
==================================================================================================================================================================================================================
Install  1 Package

Total download size: 3.6 M
Installed size: 12 M
Is this ok [y/N]: y
Downloading Packages:
4b31246c89a3b0d6ec3d0120181b2e556f2a4f483a412c1f89bca3d475061438-google-cloud-sdk-gke-gcloud-auth-plugin-457.0.0-1.x86_64.rpm                                                     9.9 MB/s | 3.6 MB     00:00    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                             9.8 MB/s | 3.6 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                          1/1 
  Installing       : google-cloud-sdk-gke-gcloud-auth-plugin-457.0.0-1.x86_64                                                                                                                                 1/1 
  Running scriptlet: google-cloud-sdk-gke-gcloud-auth-plugin-457.0.0-1.x86_64                                                                                                                                 1/1 
  Verifying        : google-cloud-sdk-gke-gcloud-auth-plugin-457.0.0-1.x86_64                                                                                                                                 1/1 

Installed:
  google-cloud-sdk-gke-gcloud-auth-plugin-457.0.0-1.x86_64                                                                                                                                                        

Complete!

Check the version
dave@dave:~$ gke-gcloud-auth-plugin --version
Kubernetes v1.28.2-alpha+dafa3f6c671d0a0d879f3b203588c782ecb87a18

Update the kubectl configuration to use the plugin:
$ gcloud container clusters get-credentials dave-cluster \
    --zone=europe-west10
Fetching cluster endpoint and auth data.
kubeconfig entry generated for dave-cluster.
dave@dave:~$ kubectl get namespaces
NAME                       STATUS   AGE
default                    Active   13m
gke-gmp-system             Active   12m
gke-managed-filestorecsi   Active   13m
gmp-public                 Active   12m
kube-node-lease            Active   13m
kube-public                Active   13m
kube-system                Active   13m

Interact with k8s cluster via kubectl
dave@dave:~$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://34.32.43.197
  name: gke_dave-terraform_europe-west10_dave-cluster
contexts:
- context:
    cluster: gke_dave-terraform_europe-west10_dave-cluster
    user: gke_dave-terraform_europe-west10_dave-cluster
  name: gke_dave-terraform_europe-west10_dave-cluster
current-context: gke_dave-terraform_europe-west10_dave-cluster
kind: Config
preferences: {}
users:
- name: gke_dave-terraform_europe-west10_dave-cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args: null
      command: gke-gcloud-auth-plugin
      env: null
      installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
        https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
      interactiveMode: IfAvailable
      provideClusterInfo: true

Current context
dave@dave:~$ kubectl config current-context
gke_dave-terraform_europe-west10_dave-cluster

Store cluster info
$ gcloud container clusters get-credentials dave-cluster \
    --zone=europe-west10
Fetching cluster endpoint and auth data.
kubeconfig entry generated for dave-cluster.



Google HOWTO for GKE k8s cluster creation

Create GKE cluster in GCP

Enable Google Kubernetes Engine in a Cloud project

For access to Google Kubernetes Engine, select or create a Cloud project to work in, then enable the required APIs:

  1.  to ensure that you have the permissions you need, or select an existing project in which you have the relevant permissions.

  2. The necessary APIs are enabled:
    • Kubernetes Engine API
    • Artifact Registry API


Create a GKE cluster

  1. Click the Navigation menu  icon, then Kubernetes Engine.

    You can see where it is by clicking the following button:

  2. Click Clusters.

  3. Click Create.

  4. Choose Standard mode and click Configure.

  5. In the Name field, enter the name hello-cluster.

  6. Under Location type, select Zonal and then select a Compute Engine zone from the Zone drop-down list, such as us-west1-a.

  7. Click Create. This creates a GKE cluster. After the cluster is ready, a green checkmark appears next to the cluster name.

Deploy the sample app to GKE

  1. Click Workloads.

  2. Click Deploy.

  3. In the Edit container section, select Existing container image.

  4. In the Image path field, click Select.

  5. In the Select container image pane, select the hello-app image you pushed to Artifact Registry.

  6. Click Select.

  7. Click Done.

  8. Click Continue.

  9. In the Configuration section, under Labels, enter app for Key
    and hello-app for Value.

  10. Under the Configuration section, click the View YAML button under Configuration YAML. This opens a YAML configuration file representing the two Kubernetes API resources about to be deployed into your cluster.

  11. Click Close.

  12. Click Deploy.

    When the Deployment Pods are ready, the Deployment details page opens.

  13. Under Managed pods, note the three running Pods for the hello-app Deployment.

Expose a sample app to the internet

  1. Click Workloads.

  2. Click on hello-app in the Name column.

  3. From the Deployment details page, click the Actions > Expose button.

  4. In the Expose dialog, under the Port Mapping section, set

  5. Click Expose to create a Kubernetes Service for hello-app.

    When the Load Balancer is ready, the Service details page opens.

  6. Scroll down to the Exposing services secion and copy the external IP from the Endpoints column for the newly exposed Load balancer .

    • Note that Endpoints are used as External IP addresses for the next sections.

Click Next to learn how to deploy a new version of your app.

🎉 Success

You have successfully deployed a containerized web application!



Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, delete your project if you're not going to use it again. If you intend to use it again, you can delete the individual resources.

Delete the project

To delete the Cloud project:

```bash
gcloud projects delete ${PROJECT_ID}
```

Delete individual resources

  1. Delete the Service: This deallocates the Cloud Load Balancer created for your Service:

    kubectl delete service \ hello-app-service
  2. Delete the cluster: This deletes the resources that make up the cluster. Replace COMPUTE_ZONE in the command below with your own zone:

    gcloud container clusters delete \ hello-cluster --zone \ COMPUTE_ZONE
  3. Delete your container images: This deletes the Docker images you pushed to Artifact Registry. Replace PROJECT-ID with your own:

    gcloud artifacts docker images \ delete \ ${REGION}-docker.pkg.dev/${PROJECT_ID}/hello-repo/hello-app:v1 \ --delete-tags --quiet gcloud artifacts docker images \ delete \ ${REGION}-docker.pkg.dev/${PROJECT_ID}/hello-repo/hello-app:v2 \ --delete-tags --quiet

Do more with Google Kubernetes Engine

Wednesday, December 13, 2023

Setup Weblogic Kubernetes ( k8s) Operator in GCP - Install the operator and ingress controller

HOWTO 



Install the operator and ingress controller             

 Set up the operator Helm chart access

$ helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts --force-update
"weblogic-operator" has been added to your repositories

$ helm repo list
NAME                    URL                                                         
weblogic-operator       https://oracle.github.io/weblogic-kubernetes-operator/charts
List versions
$ helm search repo weblogic-operator/weblogic-operator --versions
NAME                                    CHART VERSION   APP VERSION     DESCRIPTION                                      
weblogic-operator/weblogic-operator     4.1.7           4.1.7           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.6           4.1.6           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.5           4.1.5           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.4           4.1.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.3           4.1.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.2           4.1.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.1           4.1.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.1.0           4.1.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.10          4.0.10          Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.9           4.0.9           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.8           4.0.8           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.7           4.0.7           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.6           4.0.6           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.5           4.0.5           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.4           4.0.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.3           4.0.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.2           4.0.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.1           4.0.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     4.0.0           4.0.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.11          3.4.11          Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.10          3.4.10          Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.9           3.4.9           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.8           3.4.8           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.7           3.4.7           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.6           3.4.6           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.5           3.4.5           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.4           3.4.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.3           3.4.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.2           3.4.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.1           3.4.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.4.0           3.4.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.8           3.3.8           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.7           3.3.7           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.6           3.3.6           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.5           3.3.5           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.4           3.3.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.3           3.3.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.2           3.3.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.1           3.3.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.3.0           3.3.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.5           3.2.5           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.4           3.2.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.3           3.2.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.2           3.2.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.1           3.2.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.2.0           3.2.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.1.4           3.1.4           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.1.3           3.1.3           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.1.2           3.1.2           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.1.1           3.1.1           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.1.0           3.1.0           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.0.4                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.0.3                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.0.2                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.0.1                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     3.0.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.6.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.5.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.4.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.3.1                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.3.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.2.1                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.2.0                           Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.1                             Helm chart for configuring the WebLogic operator.
weblogic-operator/weblogic-operator     2.0.1                           Helm chart for configuring the WebLogic operator.
Inspect the operator Helm chart
$ helm show values weblogic-operator/weblogic-operator
# Copyright (c) 2018, 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

# serviceAccount specifies the name of the ServiceAccount in the operator's namespace that the
# operator will use to make requests to the Kubernetes API server.
# The customer is responsible for creating the ServiceAccount in the same namespace as this Helm release.
# If not specified, the operator will use the Helm release namespace's 'default' ServiceAccount.
serviceAccount: default

# domainNamespaceSelectionStrategy specifies how the operator will select the set of namespaces
# that it will manage. Legal values are: LabelSelector, RegExp, List, and Dedicated.
# If set to 'LabelSelector', then the operator will manage the set of namespaces discovered by a list
# of namespaces using the value specified by 'domainNamespaceLabelSelector' as a label selector.
# If set to 'RegExp', then the operator will manage the set of namespaces discovered by a list
# of namespaces using the value specified by 'domainNamespaceRegExp' as a regular expression matched
# against the namespace names.
# If set to 'List', then the operator will manage the set of namespaces listed by the 'domainNamespaces' value.
# If set to 'Dedicated', then operator will manage WebLogic Domains only in the same namespace
# where the operator itself is deployed, which is the namespace of the Helm release.
# If not specified, the default is LabelSelector
domainNamespaceSelectionStrategy: LabelSelector

# domainNamespaceLabelSelector specifies the label selector value that the operator will use when listing
# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
# if 'domainNamespaceSelectionStrategy' is not 'LabelSelector'. If not specified, the default is "weblogic-operator=enabled"
#
# Example: manage any namespace with a label named "weblogic-operator" that has value "enabled".
#
# domainNamespaceLabelSelector: 'weblogic-operator=enabled'

# domainNamespaceRegExp specifies a regular expression that will be matched against namespace names when listing
# namespaces in search of the namespaces that contain WebLogic Domains that this operator will manage. Ignored
# if 'domainNamespaceSelectionStrategy' is not 'RegExp'.
#
# Example: manage any namespace where the namespace name starts with "prod".
#
# domainNamespaceRegExp: ^prod

# domainNamespaces specifies list of WebLogic Domain namespaces that this operator manages. This value
# is ignored if 'domainNamespaceSelectionStrategy' is not 'List'. The customer is responsible for creating these
# namespaces. If not specified, then the operator will manage WebLogic Domains in the Kubernetes 'default' namespace.
#
# Example: In the configuration below, the operator will manage namespace1 and namespace2.
#
# domainNamespaces:
# - "namespace1"
# - "namespace2"

# enableClusterRoleBinding specifies whether the roles necessary for the operator to manage domains
# will be granted using a ClusterRoleBinding rather than using RoleBindings in each managed namespace.
# If not specified, the default is true unless 'domainNamespaceSelectionStrategy' is 'Dedicated, in which
# case this value is ignored as all resources will be created in the namespace where the operator is deployed.
#
enableClusterRoleBinding: true

# image specifies the container image containing the operator.
image: "ghcr.io/oracle/weblogic-kubernetes-operator:4.1.7"

# imagePullPolicy specifies the image pull policy for the operator's container image.
imagePullPolicy: IfNotPresent

# imagePullSecrets contains an optional list of Kubernetes Secrets, in the operator's namespace,
# that are needed to access the registry containing the operator's container image.
# The customer is responsible for creating the Secret.
# If no Secrets are required, then omit this property.
#
# Example: a Secret is needed, and has been stored in 'my-operator-secret'
#
# imagePullSecrets:
# - name: "my-operator-secret"

# enableRest specifies whether the operator's REST interface is enabled. Beginning with version 4.0.5,
# the REST interface will be disabled by default.
# enableRest: true

# externalRestEnabled specifies whether the operator's REST interface is exposed
# outside the Kubernetes cluster on the port specified by the 'externalRestHttpsPort'
# property. Ignored if 'enableRest' is not true.
#
# If set to true, then the customer must provide the SSL certificate and private key for
# the operator's external REST interface by specifying the 'externalOperatorCert' and
# 'externalOperatorKey' properties.
externalRestEnabled: false

# externalRestHttpsPort specifies the node port that should be allocated for the external operator REST HTTPS interface.
# This parameter is required if 'externalRestEnabled' is true.
# Otherwise, it is ignored.
externalRestHttpsPort: 31001

# The name of the Secret used to store the certificate and private key to use for the external operator REST HTTPS interface.
# The Secret has to be created in the same namespace of the WebLogic operator.
# This parameter is required if 'externalRestEnabled' is true. Otherwise, it is ignored.
# As example, an external REST identity can be created using the following sample script
# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh
# externalRestIdentitySecret:

# elkIntegrationEnabled specifies whether ELK integration is enabled.
elkIntegrationEnabled: false

# logStashImage specifies the container image containing Logstash.
# This parameter is ignored if 'elkIntegrationEnabled' is false.
logStashImage: "logstash:6.8.23"

# elasticSearchHost specifies the hostname of where elasticsearch is running.
# This parameter is ignored if 'elkIntegrationEnabled' is false.
elasticSearchHost: "elasticsearch.default.svc.cluster.local"

# elasticSearchPort specifies the port number of where elasticsearch is running.
# This parameter is ignored if 'elkIntegrationEnabled' is false.
elasticSearchPort: 9200

# elasticSearchProtocol specifies the protocol to be used for communication with elasticsearch.
# This parameter is ignored if 'elkIntegrationEnabled' is false.
elasticSearchProtocol: http

# createlogStashConfigMap specifies whether a ConfigMap named
# weblogic-operator-logstash-cm should be created during helm install.
# The ConfigMap contains the Logstash pipeline configuration for the Logstash
# container running in the operator pod.
# If set to true, a ConfigMap will be created during Helm install using the
# logstash.conf file in the kubernetes/samples/charts/weblogic-operator directory.
# Set createLogStashConfigMap to false if the ConfigMap
# already exists in the operator's namespace with the Logstash 
# configuration provided by the customer.
# This parameter is ignored if 'elkIntegrationEnabled' is false.
createLogStashConfigMap: true

# featureGates specifies a set of key=value pairs separated by commas that describe whether a given
# operator feature is enabled. You enable a feature by including a key=value pair where the key is the
# feature name and the value is "true". This will allow the operator team to release features that
# are not yet ready to be enabled by default, but that are ready for testing by customers. Once a feature is
# stable then it will be enabled by default and can not be disabled using this configuration.
# featureGates: "...,AuxiliaryImage=true"

# javaLoggingLevel specifies the Java logging level for the operator. This affects the operator pod's
# log output and the contents of log files in the container's /logs/ directory.
# Valid values are: "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", and "FINEST".
javaLoggingLevel: "INFO"

# javaLoggingFileSizeLimit specifies the maximum size in bytes for an individual Java logging file in the operator container's
# /logs/ directory.
javaLoggingFileSizeLimit: 20000000

# javaLoggingFileCount specifies the number of Java logging files to preserve in the operator container's /logs/
# directory as the files are rotated.
javaLoggingFileCount: 10

# labels specifies a set of key-value labels that will be added to each pod running the operator.
# See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
#labels:

# annotations specifies a set of key-value annotations that will be added to each pod running the operator.
# See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
#annotations:

# nodeSelector specifies a matching rule that the Kubernetes scheduler will use when selecting the node
# where the operator will run. If the nodeSelector value is specified, then this content will be added to
# the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
# for more information on node selectors.
#nodeSelector:
 
# webhookOnly specifies whether only the conversion webhook should be installed during the helm install
# and that the operator installation should be skipped.
# By default, the helm install command installs both the operator and the conversion webhook.
# If set to true, the helm install will install only the conversion webhook (and not the operator).
# The default value is false.
webhookOnly: false

# operatorOnly specifies whether only the operator should be installed during the helm install and that 
# the conversion webhook installation should be skipped.
# By default, the helm install command installs both the operator and the conversion webhook.
# If set to true, the helm install will install only the operator (and not the conversion webhook).
# The default value is false.
operatorOnly: false
 
# preserveWebhook specifies whether the previous webhook deployment should be preserved
# when the chart is uninstalled using helm uninstall.
# By default, the helm uninstall will remove both the webhook deployment and the operator deployment.
# If set to true, the helm uninstall command will skip removing the webhook deployment.
# The default value is false.
preserveWebhook: false

# affinity specifies a set of matching rules related to the presence of other workloads that the Kubernetes scheduler
# will use when selecting the node where the operator will run. If the affinity value is specified, then this content
# will be added to the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
# for more information on affinity and anti-affinity.
#affinity:

# tolerations and taints work together to ensure that pods are not scheduled on inappropriate nodes. If the tolerations value is specified,
# then this content will be added to the operator's deployment. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
# for more information on tolerations and taints.
#tolerations:

# Values related to debugging the operator.
# Customers should not need to use the following properties

# remoteDebugNodePortEnabled specifies whether the operator will provide a Java remote debug interface on the
# provided port. If the 'suspendOnDebugStartup' property is specified, the operator will suspend execution
# until a remote debugger has attached.
# The 'internalDebugHttpPort' property controls the port number inside the Kubernetes
# cluster and the 'externalDebugHttpPort' property controls the port number outside
# the Kubernetes cluster.
remoteDebugNodePortEnabled: false

#suspendOnDebugStartup specifies whether the operator will suspend on startup when a Java remote debugging is enabled.
suspendOnDebugStartup: false

# internalDebugHttpPort specifies the port number inside the Kubernetes cluster for the operator's Java
# remote debug interface.
# This parameter is required if 'remoteDebugNodePortEnabled' is true.
# Otherwise, it is ignored.
internalDebugHttpPort: 30999

# externalDebugHttpPort specifies the node port that should be allocated for the operator's
# Java remote debug interface.
# This parameter is required if 'remoteDebugNodePortEnabled' is true.
# Otherwise, it is ignored.
externalDebugHttpPort: 30999

# webhookDebugHttpPort specifies the port number inside the Kubernetes cluster for the webhook's Java
# remote debug interface.
# This parameter is required if 'remoteDebugNodePortEnabled' is true.
# Otherwise, it is ignored.
webhookDebugHttpPort: 31999

# dns1123Fields overrides the default list of field names that the operator
# converts to DNS-1123 legal values when replacing variable references in the 
# Domain resource. The default list can be found inside the class LegalNames
# in the oracle.kubernetes.operator.helpers package.
# Supply a comma separated list of field names to customize the list of fields
# such as "name, claimName, volumeName", or leave it commented out to use 
# the default list of field names.
# dns1123Fields: ""

# introspectorJobNameSuffix overrides the default suffix that the operator uses
# to append to the domainUID to form the name of the domain introspector job name.
# Note that the resultant job name should not be more than 58 characters due to
# the Kubernetes limit to the name of a job and Kubernetes appends five additional
# characters to the name of the pod that is created by the job controller.
# The default suffix is '-introspector'.
# The default suffix in pre-3.1.0 is "-introspect-domain-job"
introspectorJobNameSuffix: "-introspector"

# externalServiceNameSuffix overrides the default suffix that the operator uses
# to append to the domainUID and the WebLogic admin server name, to form the name
# of the domain's admin server external service.
# Note that the resultant name should not be more than 63 characters due to
# the Kubernetes limit to the name of a service.
# The default suffix is '-ext'.
# The default suffix in pre-3.1.0 is "-external".
externalServiceNameSuffix: "-ext"

# clusterSizePaddingValidationEnabled specifies if additional one or two characters
# need to be reserved to account for longer managed server names because of an increased
# cluster size.
# The default value is true.
clusterSizePaddingValidationEnabled: true

# tokenReviewAuthentication, if set to true, specifies whether the operator's REST API should use
#   1. Kubernetes token review API for authenticating users, and
#   2. Kubernetes subject access review API for authorizing a user's operation (get, list,
#      patch, etc) on a resource.
#   3. Update the Domain resource using the operator's privileges.
# This parameter, if set to false, will use the caller's bearer token for any update
# to the Domain resource so that it is done using the caller's privileges.
# The default value is false.
#tokenReviewAuthentication: false

# runAsuser specifies the UID to run the operator and conversion webhook container processes. 
# If not specified, it defaults to the user specified in the operator's container image.
#runAsUser: 1000

# jvmOptions specifies a value used to control the Java process that runs the operator, such as the maximum heap size
# that will be allocated.
#jvmOptions: -XshowSettings:vm -XX:MaxRAMPercentage=70

Prepare an operator namespace and service account


Create a namespace for the operator.
dave@dave:~$ kubectl create namespace sample-weblogic-operator-ns
namespace/sample-weblogic-operator-ns created

Create a service account for the operator in the operator’s namespace.
$ kubectl create serviceaccount -n sample-weblogic-operator-ns sample-weblogic-operator-sa
serviceaccount/sample-weblogic-operator-sa created

Set up Helm with the location of the operator Helm chart using this format: helm repo add
$ helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts --force-update  
bash: helm: command not found...
Install package 'helm' to provide command 'helm'? [N/y] y


 * Waiting in queue... 
 * Loading list of packages.... 
The following packages have to be installed:
 helm-3.11.1-3.fc39.x86_64    The Kubernetes Package Manager
Proceed with changes? [N/y] y


 * Waiting in queue... 
 * Waiting for authentication... 
 * Waiting in queue... 
 * Downloading packages... 
 * Requesting data... 
 * Testing changes... 
 * Installing packages... 
"weblogic-operator" has been added to your repositories

Install the operator using this format: helm install helm-release-name helm-chart-repo-name/weblogic-operator
 helm install sample-weblogic-operator weblogic-operator/weblogic-operator \
  --namespace sample-weblogic-operator-ns \
  --set serviceAccount=sample-weblogic-operator-sa \
  --wait

W1214 10:49:38.244503    9090 warnings.go:70] autopilot-default-resources-mutator:Autopilot updated Deployment sample-weblogic-operator-ns/weblogic-operator-webhook: defaulted unspecified resources for containers [weblogic-operator-webhook] (see http://g.co/gke/autopilot-defaults)
W1214 10:49:38.640698    9090 warnings.go:70] autopilot-default-resources-mutator:Autopilot updated Deployment sample-weblogic-operator-ns/weblogic-operator: defaulted unspecified resources for containers [weblogic-operator] (see http://g.co/gke/autopilot-defaults)

NAME: sample-weblogic-operator
LAST DEPLOYED: Thu Dec 14 10:49:28 2023
NAMESPACE: sample-weblogic-operator-ns
STATUS: deployed
REVISION: 1
TEST SUITE: None


Verify that the operator’s pod is running by listing the pods in the operator’s namespace. You should see one for the operator and one for the conversion webhook, a singleton Deployment in your Kubernetes cluster that automatically and transparently upgrades domain resources.
dave@dave:~$ kubectl get pods -n sample-weblogic-operator-ns
NAME                                         READY   STATUS    RESTARTS      AGE
weblogic-operator-6677f5d6c7-rz4wl           0/1     Running   1 (20s ago)   4m6s
weblogic-operator-webhook-856586b545-kgzwb   0/1     Running   1 (44s ago)   4m6s

Verify that the operator is up and running by viewing the operator pod’s log.
ave@dave:~$ kubectl logs -n sample-weblogic-operator-ns -c weblogic-operator deployments/weblogic-operator
Launching Oracle WebLogic Server Kubernetes Operator...
VM settings:
    Max. Heap Size (Estimated): 348.00M
    Using VM: Java HotSpot(TM) 64-Bit Server VM

{"timestamp":"2023-12-14T09:53:40.891044705Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.helpers.HealthCheckHelper","method":"createAndValidateKubernetesVersion","timeInMillis":1702547620891,"message":"Kubernetes version is: v1.27.3-gke.100","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2023-12-14T09:53:42.879456951Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1702547622879,"message":"Oracle WebLogic Kubernetes Operator, version: 4.1.7, implementation: 56168ebd623a134e638b23608109415459cb5a10.56168eb, build time: 2023-11-27T15:26:28+0000","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2023-12-14T09:53:42.975662989Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"lambda$logStartup$0","timeInMillis":1702547622975,"message":"The following optional operator features are enabled: []","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2023-12-14T09:53:42.981779347Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1702547622981,"message":"Operator namespace is: sample-weblogic-operator-ns","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2023-12-14T09:53:42.986408945Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1702547622986,"message":"Operator service account is: sample-weblogic-operator-sa","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2023-12-14T09:53:52.190762872Z","thread":37,"fiber":"fiber-1 NOT_COMPLETE","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain","method":"logStartingLivenessMessage","timeInMillis":1702547632190,"message":"Starting operator liveness Thread","exception":"","code":"","headers":{},"body":""}

Create a Traefik ingress controller


Set up Helm with the location of the Traefik Helm chart using
helm repo add traefik https://helm.traefik.io/traefik --force-update
Create a namespace for the ingress controller.
kubectl create namespace traefik
Install Traefik using this
$ helm install traefik-operator traefik/traefik \
    --namespace traefik \
    --set "ports.web.nodePort=30305" \
    --set "ports.websecure.nodePort=30443" \
    --set "kubernetes.namespaces={traefik}"
W1214 10:56:29.375049    9468 warnings.go:70] autopilot-default-resources-mutator:Autopilot updated Deployment traefik/traefik-operator: defaulted unspecified resources for containers [traefik-operator] (see http://g.co/gke/autopilot-defaults)
NAME: traefik-operator
LAST DEPLOYED: Thu Dec 14 10:56:25 2023
NAMESPACE: traefik
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Traefik Proxy v2.10.6 has been deployed successfully on traefik namespace !

This deploys the Traefik controller with plain text node port 30305, SSL node port 30443, and kubernetes.namespaces specifically set.

Check GKE cluster in GCP console


Weblogic operator